diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-08-21 21:30:41 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-08-23 21:01:37 +0200 |
commit | f8b6c3949e2c1f23549a2ef879e728cdb7149235 (patch) | |
tree | 256fc0266b2f32d3cc2c868f26c954c8ecc21a04 | |
parent | 9509a46683e40fc2feea6631b701b766797b7882 (diff) |
CharBrd 7: Border shadow
1, New character attribute
- Add the three shadow members to font
(width, color, location)
2, Painting
- Extract the shadow painting to a local function
and use that for character shadow (paintfrm.cxx)
- Reduce the painting rectangle of background
(shadow doesn't inherites the background of content)
3, Border merge
- Use text portion join members to skip shadow
when neccessary.
4, Vertical text
- Get shadow space dependant from oritentation and
border merge.
5, UNO API and ODF filter
Paragraph: ParaShadowFormat -> Character: CharShadowFormat
Change-Id: Ief4669990d238016c3ffc18a2609a3df7d9dddbf
34 files changed, 732 insertions, 252 deletions
diff --git a/offapi/com/sun/star/style/CharacterProperties.idl b/offapi/com/sun/star/style/CharacterProperties.idl index 920c55dcb726..c4f54527f9b7 100644 --- a/offapi/com/sun/star/style/CharacterProperties.idl +++ b/offapi/com/sun/star/style/CharacterProperties.idl @@ -24,6 +24,7 @@ #include <com/sun/star/awt/FontSlant.idl> #include <com/sun/star/container/XNameContainer.idl> #include <com/sun/star/table/BorderLine2.idl> +#include <com/sun/star/table/ShadowFormat.idl> module com { module sun { module star { module style { @@ -428,6 +429,12 @@ published service CharacterProperties **/ [property, optional] long CharBottomBorderDistance; + /** Determines the type, color, and width of the shadow. + * + * @since LibreOffice 4.2 + **/ + [optional, property] com::sun::star::table::ShadowFormat CharShadowFormat; + }; }; }; }; }; diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv index bbf37c193e67..85b06ecc25f5 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv @@ -143,6 +143,7 @@ "SwXCellRange";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" "SwXCellRange";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" "SwXCellRange";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" +"SwXCellRange";"com::sun::star::style::CharacterProperties";"CharShadowFormat#optional" "SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"getDataArray()" "SwXCellRange";"com::sun::star::sheet::XCellRangeData#optional";"setDataArray()" "SwXCellRange";"com::sun::star::style::ParagraphPropertiesAsian#optional";"ParaIsHangingPunctuation" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv index fd964f8ef408..1f45acc02db8 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv @@ -165,6 +165,7 @@ "SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" "SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" "SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" +"SwXTextCursor";"com::sun::star::style::CharacterProperties";"CharShadowFormat#optional" "SwXTextCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()" "SwXTextCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv index 261865374e2e..7beae7455988 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv @@ -139,6 +139,7 @@ "SwXTextRange";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" "SwXTextRange";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" "SwXTextRange";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" +"SwXTextRange";"com::sun::star::style::CharacterProperties";"CharShadowFormat#optional" "SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextRange";"com::sun::star::beans::XPropertySet";"setPropertyValue()" "SwXTextRange";"com::sun::star::beans::XPropertySet";"getPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv index b2fbb91c2f2b..79f86c910b64 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv @@ -142,6 +142,7 @@ "SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" "SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" "SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" +"SwXTextTableCursor";"com::sun::star::style::CharacterProperties";"CharShadowFormat#optional" "SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()" "SwXTextTableCursor";"com::sun::star::beans::XPropertySet";"getPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv index 6ecd7ca2b1bd..85ab9e70156c 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv @@ -175,6 +175,7 @@ "SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" "SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" "SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" +"SwXTextViewCursor";"com::sun::star::style::CharacterProperties";"CharShadowFormat#optional" "SwXTextViewCursor";"com::sun::star::document::XDocumentInsertable#optional";"insertDocumentFromURL()" "SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "SwXTextViewCursor";"com::sun::star::beans::XPropertySet";"setPropertyValue()" diff --git a/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv b/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv index c7d16cda2f99..26a0868845ad 100644 --- a/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv +++ b/qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv @@ -101,6 +101,7 @@ "CharacterStyle";"com::sun::star::style::CharacterProperties";"CharRightBorderDistance#optional" "CharacterStyle";"com::sun::star::style::CharacterProperties";"CharBottomBorderDistance#optional" "CharacterStyle";"com::sun::star::style::CharacterProperties";"CharTopBorderDistance#optional" +"CharacterStyle";"com::sun::star::style::CharacterProperties";"CharShadowFormat#optional" "CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()" "CharacterStyle";"com::sun::star::beans::XPropertySet";"setPropertyValue()" "CharacterStyle";"com::sun::star::beans::XPropertySet";"getPropertyValue()" diff --git a/sw/inc/charatr.hxx b/sw/inc/charatr.hxx index 5ac0b3401b14..b0a77c27e7d8 100644 --- a/sw/inc/charatr.hxx +++ b/sw/inc/charatr.hxx @@ -101,6 +101,8 @@ inline const SvxCharHiddenItem &SwAttrSet::GetCharHidden( sal_Bool bInP ) const { return (const SvxCharHiddenItem&)Get( RES_CHRATR_HIDDEN, bInP ); } inline const SvxBoxItem &SwAttrSet::GetCharBorder( sal_Bool bInP ) const { return (const SvxBoxItem&)Get( RES_CHRATR_BOX, bInP ); } +inline const SvxShadowItem &SwAttrSet::GetCharShadow( sal_Bool bInP ) const + { return (const SvxShadowItem&)Get( RES_CHRATR_SHADOW, bInP ); } // implementation of the character attribute methods of SwFmt @@ -164,6 +166,8 @@ inline const SvxCharHiddenItem &SwFmt::GetCharHidden( sal_Bool bInP ) const { return aSet.GetCharHidden(bInP); } inline const SvxBoxItem &SwFmt::GetCharBorder( sal_Bool bInP ) const { return aSet.GetCharBorder(bInP); } +inline const SvxShadowItem &SwFmt::GetCharShadow( sal_Bool bInP ) const + { return aSet.GetCharShadow(bInP); } #endif diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx index 6e8ad24b0f5a..2063ee34c9e9 100644 --- a/sw/inc/format.hxx +++ b/sw/inc/format.hxx @@ -210,6 +210,7 @@ public: inline const SvxCharReliefItem &GetCharRelief( sal_Bool = sal_True ) const; inline const SvxCharHiddenItem &GetCharHidden( sal_Bool = sal_True ) const; inline const SvxBoxItem &GetCharBorder( sal_Bool = sal_True ) const; + inline const SvxShadowItem &GetCharShadow( sal_Bool = sal_True ) const; /// Frame-attributes - implemented in frmatr.hxx. inline const SwFmtFillOrder &GetFillOrder( sal_Bool = sal_True ) const; diff --git a/sw/inc/hintids.hxx b/sw/inc/hintids.hxx index 37d5a396cde0..da260317f728 100644 --- a/sw/inc/hintids.hxx +++ b/sw/inc/hintids.hxx @@ -89,6 +89,10 @@ RES_CHRATR_BEGIN = HINT_BEGIN, RES_CHRATR_OVERLINE, // 38 RES_CHRATR_RSID, // 39 RES_CHRATR_BOX, // 40 + RES_CHRATR_SHADOW, // 41 + RES_CHRATR_DUMMY1, // 42 + RES_CHRATR_DUMMY2, // 43 + RES_CHRATR_DUMMY3, // 44 RES_CHRATR_END }; @@ -114,27 +118,27 @@ RES_TXTATR_BEGIN = RES_CHRATR_END, - META and METAFIELD must precede CJK_RUBY and INETFMT */ RES_TXTATR_WITHEND_BEGIN = RES_TXTATR_BEGIN , - RES_TXTATR_REFMARK = RES_TXTATR_WITHEND_BEGIN, // 41 - RES_TXTATR_TOXMARK, // 42 - RES_TXTATR_META, // 43 - RES_TXTATR_METAFIELD, // 44 - RES_TXTATR_AUTOFMT, // 45 - RES_TXTATR_INETFMT, // 46 - RES_TXTATR_CHARFMT, // 47 - RES_TXTATR_CJK_RUBY, // 48 - RES_TXTATR_UNKNOWN_CONTAINER, // 49 - RES_TXTATR_DUMMY5, // 50 + RES_TXTATR_REFMARK = RES_TXTATR_WITHEND_BEGIN, // 45 + RES_TXTATR_TOXMARK, // 46 + RES_TXTATR_META, // 47 + RES_TXTATR_METAFIELD, // 48 + RES_TXTATR_AUTOFMT, // 49 + RES_TXTATR_INETFMT, // 50 + RES_TXTATR_CHARFMT, // 51 + RES_TXTATR_CJK_RUBY, // 52 + RES_TXTATR_UNKNOWN_CONTAINER, // 53 + RES_TXTATR_DUMMY5, // 54 RES_TXTATR_WITHEND_END, // all TextAttributes without an end RES_TXTATR_NOEND_BEGIN = RES_TXTATR_WITHEND_END, - RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN, // 51 - RES_TXTATR_FLYCNT, // 52 - RES_TXTATR_FTN, // 53 - RES_TXTATR_DUMMY4, // 54 - RES_TXTATR_DUMMY3, // 55 - RES_TXTATR_DUMMY1, // 56 - RES_TXTATR_DUMMY2, // 57 + RES_TXTATR_FIELD = RES_TXTATR_NOEND_BEGIN, // 55 + RES_TXTATR_FLYCNT, // 56 + RES_TXTATR_FTN, // 57 + RES_TXTATR_DUMMY4, // 58 + RES_TXTATR_DUMMY3, // 59 + RES_TXTATR_DUMMY1, // 60 + RES_TXTATR_DUMMY2, // 61 RES_TXTATR_NOEND_END, RES_TXTATR_END = RES_TXTATR_NOEND_END }; @@ -142,25 +146,25 @@ RES_TXTATR_END = RES_TXTATR_NOEND_END enum RES_PARATR { RES_PARATR_BEGIN = RES_TXTATR_END, - RES_PARATR_LINESPACING = RES_PARATR_BEGIN, // 58 - RES_PARATR_ADJUST, // 59 - RES_PARATR_SPLIT, // 60 - RES_PARATR_ORPHANS, // 61 - RES_PARATR_WIDOWS, // 62 - RES_PARATR_TABSTOP, // 63 - RES_PARATR_HYPHENZONE, // 64 - RES_PARATR_DROP, // 65 - RES_PARATR_REGISTER, // 66 - RES_PARATR_NUMRULE, // 67 - RES_PARATR_SCRIPTSPACE, // 68 - RES_PARATR_HANGINGPUNCTUATION, // 69 - RES_PARATR_FORBIDDEN_RULES, // 70 - RES_PARATR_VERTALIGN, // 71 - RES_PARATR_SNAPTOGRID, // 72 - RES_PARATR_CONNECT_BORDER, // 73 - RES_PARATR_OUTLINELEVEL, // 74 - RES_PARATR_RSID, // 75 - RES_PARATR_GRABBAG, // 76 + RES_PARATR_LINESPACING = RES_PARATR_BEGIN, // 62 + RES_PARATR_ADJUST, // 63 + RES_PARATR_SPLIT, // 64 + RES_PARATR_ORPHANS, // 65 + RES_PARATR_WIDOWS, // 66 + RES_PARATR_TABSTOP, // 67 + RES_PARATR_HYPHENZONE, // 68 + RES_PARATR_DROP, // 69 + RES_PARATR_REGISTER, // 70 + RES_PARATR_NUMRULE, // 71 + RES_PARATR_SCRIPTSPACE, // 72 + RES_PARATR_HANGINGPUNCTUATION, // 73 + RES_PARATR_FORBIDDEN_RULES, // 74 + RES_PARATR_VERTALIGN, // 75 + RES_PARATR_SNAPTOGRID, // 76 + RES_PARATR_CONNECT_BORDER, // 77 + RES_PARATR_OUTLINELEVEL, // 78 + RES_PARATR_RSID, // 79 + RES_PARATR_GRABBAG, // 80 RES_PARATR_END }; @@ -169,101 +173,101 @@ RES_PARATR_END enum RES_PARATR_LIST { RES_PARATR_LIST_BEGIN = RES_PARATR_END, - RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN, // 77 - RES_PARATR_LIST_LEVEL, // 78 - RES_PARATR_LIST_ISRESTART, // 79 - RES_PARATR_LIST_RESTARTVALUE, // 80 - RES_PARATR_LIST_ISCOUNTED, // 81 + RES_PARATR_LIST_ID = RES_PARATR_LIST_BEGIN, // 81 + RES_PARATR_LIST_LEVEL, // 82 + RES_PARATR_LIST_ISRESTART, // 83 + RES_PARATR_LIST_RESTARTVALUE, // 84 + RES_PARATR_LIST_ISCOUNTED, // 85 RES_PARATR_LIST_END }; enum RES_FRMATR { RES_FRMATR_BEGIN = RES_PARATR_LIST_END, - RES_FILL_ORDER = RES_FRMATR_BEGIN, // 82 - RES_FRM_SIZE, // 83 - RES_PAPER_BIN, // 84 - RES_LR_SPACE, // 85 - RES_UL_SPACE, // 86 - RES_PAGEDESC, // 87 - RES_BREAK, // 88 - RES_CNTNT, // 89 - RES_HEADER, // 90 - RES_FOOTER, // 91 - RES_PRINT, // 92 - RES_OPAQUE, // 93 - RES_PROTECT, // 94 - RES_SURROUND, // 95 - RES_VERT_ORIENT, // 96 - RES_HORI_ORIENT, // 97 - RES_ANCHOR, // 98 - RES_BACKGROUND, // 99 - RES_BOX, // 100 - RES_SHADOW, // 101 - RES_FRMMACRO, // 102 - RES_COL, // 103 - RES_KEEP, // 104 - RES_URL, // 105 - RES_EDIT_IN_READONLY, // 106 - RES_LAYOUT_SPLIT, // 107 - RES_CHAIN, // 108 - RES_TEXTGRID, // 109 - RES_LINENUMBER , // 110 - RES_FTN_AT_TXTEND, // 111 - RES_END_AT_TXTEND, // 112 - RES_COLUMNBALANCE, // 113 - RES_FRAMEDIR, // 114 - RES_HEADER_FOOTER_EAT_SPACING, // 115 - RES_ROW_SPLIT, // 116 - RES_FOLLOW_TEXT_FLOW, // 117 - RES_COLLAPSING_BORDERS, // 118 - RES_WRAP_INFLUENCE_ON_OBJPOS, // 119 - RES_AUTO_STYLE, // 120 - RES_FRMATR_STYLE_NAME, // 121 - RES_FRMATR_CONDITIONAL_STYLE_NAME, // 122 - RES_FILL_STYLE, // 123 - RES_FILL_GRADIENT, // 124 + RES_FILL_ORDER = RES_FRMATR_BEGIN, // 86 + RES_FRM_SIZE, // 87 + RES_PAPER_BIN, // 88 + RES_LR_SPACE, // 89 + RES_UL_SPACE, // 90 + RES_PAGEDESC, // 91 + RES_BREAK, // 92 + RES_CNTNT, // 93 + RES_HEADER, // 94 + RES_FOOTER, // 95 + RES_PRINT, // 96 + RES_OPAQUE, // 97 + RES_PROTECT, // 98 + RES_SURROUND, // 99 + RES_VERT_ORIENT, // 100 + RES_HORI_ORIENT, // 101 + RES_ANCHOR, // 102 + RES_BACKGROUND, // 103 + RES_BOX, // 104 + RES_SHADOW, // 105 + RES_FRMMACRO, // 106 + RES_COL, // 107 + RES_KEEP, // 108 + RES_URL, // 109 + RES_EDIT_IN_READONLY, // 110 + RES_LAYOUT_SPLIT, // 111 + RES_CHAIN, // 112 + RES_TEXTGRID, // 113 + RES_LINENUMBER , // 114 + RES_FTN_AT_TXTEND, // 115 + RES_END_AT_TXTEND, // 116 + RES_COLUMNBALANCE, // 117 + RES_FRAMEDIR, // 118 + RES_HEADER_FOOTER_EAT_SPACING, // 119 + RES_ROW_SPLIT, // 120 + RES_FOLLOW_TEXT_FLOW, // 121 + RES_COLLAPSING_BORDERS, // 122 + RES_WRAP_INFLUENCE_ON_OBJPOS, // 123 + RES_AUTO_STYLE, // 124 + RES_FRMATR_STYLE_NAME, // 125 + RES_FRMATR_CONDITIONAL_STYLE_NAME, // 126 + RES_FILL_STYLE, // 127 + RES_FILL_GRADIENT, // 128 RES_FRMATR_END }; enum RES_GRFATR { RES_GRFATR_BEGIN = RES_FRMATR_END, - RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN, // 125 - RES_GRFATR_CROPGRF, // 126 - - RES_GRFATR_ROTATION, // 127 - RES_GRFATR_LUMINANCE, // 128 - RES_GRFATR_CONTRAST, // 129 - RES_GRFATR_CHANNELR, // 130 - RES_GRFATR_CHANNELG, // 131 - RES_GRFATR_CHANNELB, // 132 - RES_GRFATR_GAMMA, // 133 - RES_GRFATR_INVERT, // 134 - RES_GRFATR_TRANSPARENCY, // 135 - RES_GRFATR_DRAWMODE, // 136 - - RES_GRFATR_DUMMY1, // 137 - RES_GRFATR_DUMMY2, // 138 - RES_GRFATR_DUMMY3, // 139 - RES_GRFATR_DUMMY4, // 140 - RES_GRFATR_DUMMY5, // 141 + RES_GRFATR_MIRRORGRF = RES_GRFATR_BEGIN, // 129 + RES_GRFATR_CROPGRF, // 130 + + RES_GRFATR_ROTATION, // 131 + RES_GRFATR_LUMINANCE, // 132 + RES_GRFATR_CONTRAST, // 133 + RES_GRFATR_CHANNELR, // 134 + RES_GRFATR_CHANNELG, // 135 + RES_GRFATR_CHANNELB, // 136 + RES_GRFATR_GAMMA, // 137 + RES_GRFATR_INVERT, // 138 + RES_GRFATR_TRANSPARENCY, // 139 + RES_GRFATR_DRAWMODE, // 140 + + RES_GRFATR_DUMMY1, // 141 + RES_GRFATR_DUMMY2, // 142 + RES_GRFATR_DUMMY3, // 143 + RES_GRFATR_DUMMY4, // 144 + RES_GRFATR_DUMMY5, // 145 RES_GRFATR_END }; enum RES_BOXATR { RES_BOXATR_BEGIN = RES_GRFATR_END, - RES_BOXATR_FORMAT = RES_BOXATR_BEGIN, // 142 - RES_BOXATR_FORMULA, // 143 - RES_BOXATR_VALUE, // 144 + RES_BOXATR_FORMAT = RES_BOXATR_BEGIN, // 146 + RES_BOXATR_FORMULA, // 147 + RES_BOXATR_VALUE, // 148 RES_BOXATR_END }; enum RES_UNKNOWNATR { RES_UNKNOWNATR_BEGIN = RES_BOXATR_END, - RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 145 + RES_UNKNOWNATR_CONTAINER = RES_UNKNOWNATR_BEGIN,// 149 RES_UNKNOWNATR_END }; diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx index 7810f392a0ae..0b3513506743 100644 --- a/sw/inc/swatrset.hxx +++ b/sw/inc/swatrset.hxx @@ -146,6 +146,7 @@ class SwAttrPool : public SfxItemPool // map for binary filter is necessary (version map 5). static sal_uInt16* pVersionMap5; static sal_uInt16* pVersionMap6; + static sal_uInt16* pVersionMap7; SwDoc* pDoc; @@ -249,6 +250,7 @@ public: inline const SvxCharReliefItem &GetCharRelief( sal_Bool = sal_True ) const; inline const SvxCharHiddenItem &GetCharHidden( sal_Bool = sal_True ) const; inline const SvxBoxItem &GetCharBorder( sal_Bool = sal_True ) const; + inline const SvxShadowItem &GetCharShadow( sal_Bool = sal_True ) const; // Frame attributes. Implementation in frmatr.hxx. inline const SwFmtFillOrder &GetFillOrder( sal_Bool = sal_True ) const; diff --git a/sw/inc/unoprnms.hxx b/sw/inc/unoprnms.hxx index 7466139e8d63..aa1c7c99066d 100644 --- a/sw/inc/unoprnms.hxx +++ b/sw/inc/unoprnms.hxx @@ -835,8 +835,9 @@ enum SwPropNameIds /* 0769 */ UNO_NAME_CHAR_RIGHT_BORDER_DISTANCE, /* 0770 */ UNO_NAME_CHAR_TOP_BORDER_DISTANCE, /* 0771 */ UNO_NAME_CHAR_BOTTOM_BORDER_DISTANCE, +/* 0772 */ UNO_NAME_CHAR_SHADOW_FORMAT, -/* 0772 */ SW_PROPNAME_END +/* 0773 */ SW_PROPNAME_END // new items in this array must match SwPropNameTab aPropNameTab }; diff --git a/sw/qa/extras/odfexport/data/charborder.odt b/sw/qa/extras/odfexport/data/charborder.odt Binary files differindex 9f37d58b76c1..8395625baf88 100644 --- a/sw/qa/extras/odfexport/data/charborder.odt +++ b/sw/qa/extras/odfexport/data/charborder.odt diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 3a248b29575d..b838312df93f 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -10,6 +10,7 @@ #include <swmodeltestbase.hxx> #include <com/sun/star/awt/Gradient.hpp> #include <com/sun/star/drawing/FillStyle.hpp> +#include <com/sun/star/table/ShadowFormat.hpp> class Test : public SwModelTestBase { @@ -200,6 +201,13 @@ void Test::testCharacterBorder() aFirstParTopBorder, aFirstParTopPadding, getProperty<table::BorderLine2>(xSet,"RightBorder"), getProperty<sal_Int32>(xSet,"RightBorderDistance")); + + // Shadow + const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"ParaShadowFormat"); + CPPUNIT_ASSERT_EQUAL(aShadow.Color, 0L); + CPPUNIT_ASSERT_EQUAL((bool)aShadow.IsTransparent, false); + CPPUNIT_ASSERT_EQUAL((int)aShadow.Location, 0); + CPPUNIT_ASSERT_EQUAL((int)aShadow.ShadowWidth, 0); } // Character border for first paragraph @@ -232,6 +240,13 @@ void Test::testCharacterBorder() getProperty<table::BorderLine2>(xSet,"CharRightBorder"), getProperty<sal_Int32>(xSet,"CharRightBorderDistance")); + // Shadow + const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"CharShadowFormat"); + CPPUNIT_ASSERT_EQUAL(aShadow.Color, 16724787L); + CPPUNIT_ASSERT_EQUAL((bool)aShadow.IsTransparent, false); + CPPUNIT_ASSERT_EQUAL((int)aShadow.Location, 2); + CPPUNIT_ASSERT_EQUAL((int)aShadow.ShadowWidth, 280); + // Check autostyle { uno::Reference< style::XAutoStyleFamily > xAutoStyleFamily(getAutoStyles("ParagraphStyles")); @@ -308,6 +323,13 @@ void Test::testCharacterBorder() getProperty<table::BorderLine2>(xSet,"CharRightBorder"), getProperty<sal_Int32>(xSet,"CharRightBorderDistance")); + // Shadow + const table::ShadowFormat aShadow = getProperty<table::ShadowFormat>(xSet,"CharShadowFormat"); + CPPUNIT_ASSERT_EQUAL(aShadow.Color, 0L); + CPPUNIT_ASSERT_EQUAL((bool)aShadow.IsTransparent, false); + CPPUNIT_ASSERT_EQUAL((int)aShadow.Location, 3); + CPPUNIT_ASSERT_EQUAL((int)aShadow.ShadowWidth, 79); + // Check character style { uno::Reference< container::XNameAccess > xStyleFamily(getStyles("CharacterStyles"), uno::UNO_QUERY); diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx index bdf8b003e7a7..aef8556081f2 100644 --- a/sw/source/core/attr/swatrset.cxx +++ b/sw/source/core/attr/swatrset.cxx @@ -53,6 +53,7 @@ SwAttrPool::SwAttrPool( SwDoc* pD ) // #i18732# - apply new version map SetVersionMap( 5, 1,130, pVersionMap5 ); SetVersionMap( 6, 1,136, pVersionMap6 ); + SetVersionMap( 7, 1,144, pVersionMap7 ); } SwAttrPool::~SwAttrPool() diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx index 812f16902a67..c9624f26326d 100644 --- a/sw/source/core/bastyp/init.cxx +++ b/sw/source/core/bastyp/init.cxx @@ -289,6 +289,10 @@ SfxItemInfo aSlotTab[] = { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, // RES_CHRATR_OVERLINE { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_RSID { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_BOX + { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_SHADOW + { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY1 + { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY2 + { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY3 { 0, 0 }, // RES_TXTATR_REFMARK { 0, 0 }, // RES_TXTATR_TOXMARK @@ -419,6 +423,7 @@ sal_uInt16* SwAttrPool::pVersionMap4 = 0; // #i18732# sal_uInt16* SwAttrPool::pVersionMap5 = 0; sal_uInt16* SwAttrPool::pVersionMap6 = 0; +sal_uInt16* SwAttrPool::pVersionMap7 = 0; const sal_Char* pMarkToTable = "table"; const sal_Char* pMarkToFrame = "frame"; @@ -498,6 +503,12 @@ void _InitCore() aAttrTab[ RES_CHRATR_HIDDEN - POOLATTR_BEGIN ] = new SvxCharHiddenItem( sal_False, RES_CHRATR_HIDDEN ); aAttrTab[ RES_CHRATR_OVERLINE- POOLATTR_BEGIN ] = new SvxOverlineItem( UNDERLINE_NONE, RES_CHRATR_OVERLINE ); aAttrTab[ RES_CHRATR_BOX - POOLATTR_BEGIN ] = new SvxBoxItem( RES_CHRATR_BOX ); + aAttrTab[ RES_CHRATR_SHADOW - POOLATTR_BEGIN ] = new SvxShadowItem( RES_CHRATR_SHADOW ); + +// CharakterAttr - Dummies + aAttrTab[ RES_CHRATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY1 ); + aAttrTab[ RES_CHRATR_DUMMY2 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY2 ); + aAttrTab[ RES_CHRATR_DUMMY3 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY3 ); aAttrTab[ RES_TXTATR_AUTOFMT- POOLATTR_BEGIN ] = new SwFmtAutoFmt; aAttrTab[ RES_TXTATR_INETFMT - POOLATTR_BEGIN ] = new SwFmtINetFmt( OUString(), OUString() ); @@ -703,6 +714,14 @@ void _InitCore() for ( i = 38; i <= 136; ++i ) SwAttrPool::pVersionMap6[ i-1 ] = i + 3; + // 7. version: + // New character attribute for character box shadow plus 3 dummies + SwAttrPool::pVersionMap7 = new sal_uInt16[ 144 ]; + for( i = 1; i <= 40; ++i ) + SwAttrPool::pVersionMap7[ i-1 ] = i; + for ( i = 41; i <= 144; ++i ) + SwAttrPool::pVersionMap7[ i-1 ] = i + 4; + SwBreakIt::_Create( ::comphelper::getProcessComponentContext() ); pCheckIt = NULL; @@ -799,6 +818,7 @@ void _FinitCore() // #i18732# delete[] SwAttrPool::pVersionMap5; delete[] SwAttrPool::pVersionMap6; + delete[] SwAttrPool::pVersionMap7; for ( sal_uInt16 i = 0; i < pGlobalOLEExcludeList->size(); ++i ) delete (*pGlobalOLEExcludeList)[i]; diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx index 4dd024af3da2..2a97182893ce 100644 --- a/sw/source/core/doc/dbgoutsw.cxx +++ b/sw/source/core/doc/dbgoutsw.cxx @@ -161,6 +161,7 @@ map<sal_uInt16,String,CompareUShort> & GetItemWhichMap() aItemWhichMap[RES_CHRATR_RELIEF] = String("CHRATR_RELIEF", RTL_TEXTENCODING_ASCII_US); aItemWhichMap[RES_CHRATR_HIDDEN] = String("CHRATR_HIDDEN", RTL_TEXTENCODING_ASCII_US); aItemWhichMap[RES_CHRATR_BOX] = String("CHRATR_BOX", RTL_TEXTENCODING_ASCII_US); + aItemWhichMap[RES_CHRATR_SHADOW] = String("CHRATR_SHADOW", RTL_TEXTENCODING_ASCII_US); aItemWhichMap[RES_TXTATR_AUTOFMT] = String("TXTATR_AUTOFMT", RTL_TEXTENCODING_ASCII_US); aItemWhichMap[RES_TXTATR_INETFMT] = String("TXTATR_INETFMT", RTL_TEXTENCODING_ASCII_US); aItemWhichMap[RES_TXTATR_REFMARK] = String("TXTATR_REFMARK", RTL_TEXTENCODING_ASCII_US); diff --git a/sw/source/core/inc/swfntcch.hxx b/sw/source/core/inc/swfntcch.hxx index d7905818454c..041757aae35e 100644 --- a/sw/source/core/inc/swfntcch.hxx +++ b/sw/source/core/inc/swfntcch.hxx @@ -21,7 +21,7 @@ #include <tools/mempool.hxx> -#define NUM_DEFAULT_VALUES 37 +#define NUM_DEFAULT_VALUES 38 #include "swcache.hxx" #include "swfont.hxx" diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 82acffd8b5fb..96840cf8be68 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -142,6 +142,10 @@ class SwFont sal_uInt16 m_nRightBorderDist; sal_uInt16 m_nLeftBorderDist; + Color m_aShadowColor; + sal_uInt16 m_nShadowWidth; + SvxShadowLocation m_aShadowLocation; + sal_uInt8 nToxCnt; // Zaehlt die Schachtelungstiefe der Tox sal_uInt8 nRefCnt; // Zaehlt die Schachtelungstiefe der Refs sal_uInt8 m_nMetaCount; // count META/METAFIELD @@ -403,7 +407,40 @@ public: sal_uInt16 GetLeftBorderSpace() const; bool HasBorder() const; - void RemoveBorders(); + + // Shadow attributes + void SetShadowColor( const Color& rColor ); + void SetShadowWidth( const sal_uInt16 nWidth ); + void SetShadowLocation( const SvxShadowLocation aLocation ); + + const Color& GetShadowColor() const { return m_aShadowColor; } + sal_uInt16 GetShadowWidth() const { return m_nShadowWidth; } + SvxShadowLocation GetShadowLocation() const { return m_aShadowLocation; } + + /** + * Get the absolute shadow location dependant from orientation. + * + * @param[in] bVertLayout true, if the container layout is vertical + * false, otherwise + * @return absolute location + **/ + SvxShadowLocation GetAbsShadowLocation( const bool bVertLayout ) const; + + /** + * Calculate the shadow space on the specified side dependant from + * the orientation and connection with neightbours. + * @see shaditem.hxx for integer constants of sides + * + * @param[in] nShadow specify the side + * @param[in] bVertLayout true, if the container layout is vertical + * false, otherwise + * @param[in] bSkipLeft relative left shadow space is skipped + * @param[in] bSkipRight relative right shadow space is skipped + * @return the shadow space + **/ + sal_uInt16 CalcShadowSpace( + const sal_uInt16 nShadow, const bool bVertLayout, + const bool bSkipLeft, const bool bSkipRight ) const; }; inline void SwFont::SetColor( const Color& rColor ) @@ -883,34 +920,62 @@ inline void SwFont::SetLeftBorderDist( const sal_uInt16 nLeftDist ) inline sal_uInt16 SwFont::GetTopBorderSpace() const { + sal_uInt16 nRet = 0; if( m_aTopBorder ) - return m_aTopBorder.get().GetScaledWidth() + m_nTopBorderDist; - else - return 0; + { + nRet += m_aTopBorder.get().GetScaledWidth() + m_nTopBorderDist; + } + if( m_aShadowLocation == SVX_SHADOW_TOPLEFT || + m_aShadowLocation == SVX_SHADOW_TOPRIGHT ) + { + nRet += m_nShadowWidth; + } + return nRet; } inline sal_uInt16 SwFont::GetBottomBorderSpace() const { + sal_uInt16 nRet = 0; if( m_aBottomBorder ) - return m_aBottomBorder.get().GetScaledWidth() + m_nBottomBorderDist; - else - return 0; + { + nRet += m_aBottomBorder.get().GetScaledWidth() + m_nBottomBorderDist; + } + if( m_aShadowLocation == SVX_SHADOW_BOTTOMLEFT || + m_aShadowLocation == SVX_SHADOW_BOTTOMRIGHT ) + { + nRet += m_nShadowWidth; + } + return nRet; } inline sal_uInt16 SwFont::GetRightBorderSpace() const { + sal_uInt16 nRet = 0; if( m_aRightBorder ) - return m_aRightBorder.get().GetScaledWidth() + m_nRightBorderDist; - else - return 0; + { + nRet += m_aRightBorder.get().GetScaledWidth() + m_nRightBorderDist; + } + if( m_aShadowLocation == SVX_SHADOW_TOPRIGHT || + m_aShadowLocation == SVX_SHADOW_BOTTOMRIGHT ) + { + nRet += m_nShadowWidth; + } + return nRet; } inline sal_uInt16 SwFont::GetLeftBorderSpace() const { + sal_uInt16 nRet = 0; if( m_aLeftBorder ) - return m_aLeftBorder.get().GetScaledWidth() + m_nLeftBorderDist; - else - return 0; + { + nRet += m_aLeftBorder.get().GetScaledWidth() + m_nLeftBorderDist; + } + if( m_aShadowLocation == SVX_SHADOW_TOPLEFT || + m_aShadowLocation == SVX_SHADOW_BOTTOMLEFT ) + { + nRet += m_nShadowWidth; + } + return nRet; } inline bool SwFont::HasBorder() const @@ -918,10 +983,25 @@ inline bool SwFont::HasBorder() const return m_aTopBorder || m_aBottomBorder || m_aLeftBorder || m_aRightBorder; } -inline void SwFont::RemoveBorders() +inline void SwFont::SetShadowColor( const Color& rColor ) { - m_aTopBorder = m_aBottomBorder = m_aLeftBorder = m_aRightBorder = boost::none; - m_nTopBorderDist = m_nBottomBorderDist = m_nRightBorderDist = m_nLeftBorderDist = 0; + m_aShadowColor = rColor; + bFntChg = sal_True; + aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; +} + +inline void SwFont::SetShadowWidth( const sal_uInt16 nWidth ) +{ + m_nShadowWidth = nWidth; + bFntChg = sal_True; + aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; +} + +inline void SwFont::SetShadowLocation( const SvxShadowLocation aLocation ) +{ + m_aShadowLocation = aLocation; + bFntChg = sal_True; + aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0; } /************************************************************************* diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d965830957f3..9a12cc7f661d 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -4143,83 +4143,65 @@ void SwTabFrm::Paint(SwRect const& rRect, SwPrintData const*const) const ((SwTabFrm*)this)->ResetComplete(); } -/************************************************************************* -|* -|* SwFrm::PaintShadow() -|* -|* Description Paints a shadow if the format requests so. -|* The shadow is always painted on the outer edge of the OutRect. -|* If needed, the OutRect is shrunk so the painting of the border can be -|* done on it. -|* -|*************************************************************************/ -/// OD 23.08.2002 #99657# -/// draw full shadow rectangle for frames with transparent drawn backgrounds. -void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, - const SwBorderAttrs &rAttrs ) const +/** + * Paint border shadow. + * + * @param[in] rRect aligned rect to clip the result + * @param[in|out] rOutRect full painting area as input + * painting area reduced by shadow space for border and background as output + * @param[in] rShadow includes shadow attributes + * @param[in] bDrawFullShadowRectangle paint full rect of shadow + * @param[in] bTop paint top part of the shadow + * @param[in] bBottom paint bottom part of the shadow + * @param[in] bLeft paint left part of the shadow + * @param[in] bRight paint right part of the shadow +**/ +static void lcl_PaintShadow( const SwRect& rRect, SwRect& rOutRect, + const SvxShadowItem& rShadow, const bool bDrawFullShadowRectangle, + const bool bTop, const bool bBottom, + const bool bLeft, const bool bRight ) { - const SvxShadowItem &rShadow = rAttrs.GetShadow(); const long nWidth = ::lcl_AlignWidth ( rShadow.GetWidth() ); const long nHeight = ::lcl_AlignHeight( rShadow.GetWidth() ); SwRects aRegion( 2 ); SwRect aOut( rOutRect ); - const sal_Bool bCnt = IsCntntFrm(); - const bool bTop = !bCnt || rAttrs.GetTopLine ( *(this) ); - const bool bBottom = !bCnt || rAttrs.GetBottomLine( *(this) ); - - SvxShadowLocation eLoc = rShadow.GetLocation(); - - if( IsVertical() ) - { - switch( eLoc ) - { - case SVX_SHADOW_BOTTOMRIGHT: eLoc = SVX_SHADOW_BOTTOMLEFT; break; - case SVX_SHADOW_TOPLEFT: eLoc = SVX_SHADOW_TOPRIGHT; break; - case SVX_SHADOW_TOPRIGHT: eLoc = SVX_SHADOW_BOTTOMRIGHT; break; - case SVX_SHADOW_BOTTOMLEFT: eLoc = SVX_SHADOW_TOPLEFT; break; - default: break; - } - } - - /// OD 23.08.2002 #99657# - determine, if full shadow rectangle have to - /// be drawn or only two shadow rectangles beside the frame. - /// draw full shadow rectangle, if frame background is drawn transparent. - /// Status Quo: - /// SwLayoutFrm can have transparent drawn backgrounds. Thus, - /// "asked" their frame format. - bool bDrawFullShadowRectangle = - ( IsLayoutFrm() && - (static_cast<const SwLayoutFrm*>(this))->GetFmt()->IsBackgroundTransparent() - ); - switch ( eLoc ) + switch ( rShadow.GetLocation() ) { case SVX_SHADOW_BOTTOMRIGHT: { if ( bDrawFullShadowRectangle ) { /// OD 06.08.2002 #99657# - draw full shadow rectangle - aOut.Top( aOut.Top() + nHeight ); - aOut.Left( aOut.Left() + nWidth ); + aOut.Top( rOutRect.Top() + nHeight ); + aOut.Left( rOutRect.Left() + nWidth ); aRegion.push_back( aOut ); } else { - aOut.Top ( aOut.Bottom() - nHeight ); - aOut.Left( aOut.Left() + nWidth ); - if ( bBottom ) + if( bBottom ) + { + aOut.Top( rOutRect.Bottom() - nHeight ); + if( bLeft ) + aOut.Left( rOutRect.Left() + nWidth ); aRegion.push_back( aOut ); - aOut.Left( aOut.Right() - nWidth ); - aOut.Top ( rOutRect.Top() + nHeight ); - if ( bBottom ) - aOut.Bottom( aOut.Bottom() - nHeight ); - else - aOut.Bottom( aOut.Bottom() + nHeight ); - aRegion.push_back( aOut ); + } + if( bRight ) + { + aOut.Left( rOutRect.Right() - nWidth ); + if( bTop ) + aOut.Top( rOutRect.Top() + nHeight ); + else + aOut.Top( rOutRect.Top() ); + if( bBottom ) + aOut.Bottom( rOutRect.Bottom() - nHeight ); + aRegion.push_back( aOut ); + } } - rOutRect.Right ( rOutRect.Right() - nWidth ); + if( bRight ) + rOutRect.Right( rOutRect.Right() - nWidth ); if( bBottom ) rOutRect.Bottom( rOutRect.Bottom()- nHeight ); } @@ -4229,28 +4211,36 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, if ( bDrawFullShadowRectangle ) { /// OD 06.08.2002 #99657# - draw full shadow rectangle - aOut.Bottom( aOut.Bottom() - nHeight ); - aOut.Right( aOut.Right() - nWidth ); + aOut.Bottom( rOutRect.Bottom() - nHeight ); + aOut.Right( rOutRect.Right() - nWidth ); aRegion.push_back( aOut ); } else { - aOut.Bottom( aOut.Top() + nHeight ); - aOut.Right ( aOut.Right() - nWidth ); - if ( bTop ) + if( bTop ) + { + aOut.Bottom( rOutRect.Top() + nHeight ); + if( bRight ) + aOut.Right( rOutRect.Right() - nWidth ); aRegion.push_back( aOut ); - aOut.Right ( aOut.Left() + nWidth ); - aOut.Bottom( rOutRect.Bottom() - nHeight ); - if ( bTop ) - aOut.Top( aOut.Top() + nHeight ); - else - aOut.Top( aOut.Top() - nHeight ); - aRegion.push_back( aOut ); + } + if( bLeft ) + { + aOut.Right( rOutRect.Left() + nWidth ); + if( bBottom ) + aOut.Bottom( rOutRect.Bottom() - nHeight ); + else + aOut.Bottom( rOutRect.Bottom() ); + if( bTop ) + aOut.Top( rOutRect.Top() + nHeight ); + aRegion.push_back( aOut ); + } } - rOutRect.Left( rOutRect.Left() + nWidth ); + if( bLeft ) + rOutRect.Left( rOutRect.Left() + nWidth ); if( bTop ) - rOutRect.Top( rOutRect.Top() + nHeight ); + rOutRect.Top( rOutRect.Top() + nHeight ); } break; case SVX_SHADOW_TOPRIGHT: @@ -4258,26 +4248,34 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, if ( bDrawFullShadowRectangle ) { /// OD 06.08.2002 #99657# - draw full shadow rectangle - aOut.Bottom( aOut.Bottom() - nHeight); - aOut.Left( aOut.Left() + nWidth ); + aOut.Bottom( rOutRect.Bottom() - nHeight); + aOut.Left( rOutRect.Left() + nWidth ); aRegion.push_back( aOut ); } else { - aOut.Bottom( aOut.Top() + nHeight ); - aOut.Left ( aOut.Left()+ nWidth ); - if ( bTop ) + if( bTop ) + { + aOut.Bottom( rOutRect.Top() + nHeight ); + if( bLeft ) + aOut.Left( rOutRect.Left() + nWidth ); aRegion.push_back( aOut ); - aOut.Left ( aOut.Right() - nWidth ); - aOut.Bottom( rOutRect.Bottom() - nHeight ); - if ( bTop ) - aOut.Top( aOut.Top() + nHeight ); - else - aOut.Top( aOut.Top() - nHeight ); - aRegion.push_back( aOut ); + } + if( bRight ) + { + aOut.Left( rOutRect.Right() - nWidth ); + if( bBottom ) + aOut.Bottom( rOutRect.Bottom() - nHeight ); + else + aOut.Bottom( rOutRect.Bottom() ); + if( bTop ) + aOut.Top( rOutRect.Top() + nHeight ); + aRegion.push_back( aOut ); + } } - rOutRect.Right( rOutRect.Right() - nWidth ); + if( bRight ) + rOutRect.Right( rOutRect.Right() - nWidth ); if( bTop ) rOutRect.Top( rOutRect.Top() + nHeight ); } @@ -4287,26 +4285,34 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, if ( bDrawFullShadowRectangle ) { /// OD 06.08.2002 #99657# - draw full shadow rectangle - aOut.Top( aOut.Top() + nHeight ); - aOut.Right( aOut.Right() - nWidth ); + aOut.Top( rOutRect.Top() + nHeight ); + aOut.Right( rOutRect.Right() - nWidth ); aRegion.push_back( aOut ); } else { - aOut.Top ( aOut.Bottom()- nHeight ); - aOut.Right( aOut.Right() - nWidth ); - if ( bBottom ) + if( bBottom ) + { + aOut.Top( rOutRect.Bottom()- nHeight ); + if( bRight ) + aOut.Right( rOutRect.Right() - nWidth ); aRegion.push_back( aOut ); - aOut.Right( aOut.Left() + nWidth ); - aOut.Top( rOutRect.Top() + nHeight ); - if ( bBottom ) - aOut.Bottom( aOut.Bottom() - nHeight ); - else - aOut.Bottom( aOut.Bottom() + nHeight ); - aRegion.push_back( aOut ); + } + if( bLeft ) + { + aOut.Right( rOutRect.Left() + nWidth ); + if( bTop ) + aOut.Top( rOutRect.Top() + nHeight ); + else + aOut.Top( rOutRect.Top() ); + if( bBottom ) + aOut.Bottom( rOutRect.Bottom() - nHeight ); + aRegion.push_back( aOut ); + } } - rOutRect.Left( rOutRect.Left() + nWidth ); + if( bLeft ) + rOutRect.Left( rOutRect.Left() + nWidth ); if( bBottom ) rOutRect.Bottom( rOutRect.Bottom() - nHeight ); } @@ -4334,6 +4340,8 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, if ( pOut->GetFillColor() != aShadowColor ) pOut->SetFillColor( aShadowColor ); + pOut->SetLineColor(); + pOut->SetDrawMode( nOldDrawMode ); for ( sal_uInt16 i = 0; i < aRegion.size(); ++i ) @@ -4359,6 +4367,53 @@ void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, /************************************************************************* |* +|* SwFrm::PaintShadow() +|* +|* Description Paints a shadow if the format requests so. +|* The shadow is always painted on the outer edge of the OutRect. +|* If needed, the OutRect is shrunk so the painting of the border can be +|* done on it. +|* +|*************************************************************************/ +/// OD 23.08.2002 #99657# +/// draw full shadow rectangle for frames with transparent drawn backgrounds. +void SwFrm::PaintShadow( const SwRect& rRect, SwRect& rOutRect, + const SwBorderAttrs &rAttrs ) const +{ + SvxShadowItem rShadow = rAttrs.GetShadow(); + + const sal_Bool bCnt = IsCntntFrm(); + const bool bTop = !bCnt || rAttrs.GetTopLine ( *(this) ); + const bool bBottom = !bCnt || rAttrs.GetBottomLine( *(this) ); + + if( IsVertical() ) + { + switch( rShadow.GetLocation() ) + { + case SVX_SHADOW_BOTTOMRIGHT: rShadow.SetLocation(SVX_SHADOW_BOTTOMLEFT); break; + case SVX_SHADOW_TOPLEFT: rShadow.SetLocation(SVX_SHADOW_TOPRIGHT); break; + case SVX_SHADOW_TOPRIGHT: rShadow.SetLocation(SVX_SHADOW_BOTTOMRIGHT); break; + case SVX_SHADOW_BOTTOMLEFT: rShadow.SetLocation(SVX_SHADOW_TOPLEFT); break; + default: break; + } + } + + /// OD 23.08.2002 #99657# - determine, if full shadow rectangle have to + /// be drawn or only two shadow rectangles beside the frame. + /// draw full shadow rectangle, if frame background is drawn transparent. + /// Status Quo: + /// SwLayoutFrm can have transparent drawn backgrounds. Thus, + /// "asked" their frame format. + const bool bDrawFullShadowRectangle = + ( IsLayoutFrm() && + (static_cast<const SwLayoutFrm*>(this))->GetFmt()->IsBackgroundTransparent() + ); + + lcl_PaintShadow(rRect, rOutRect, rShadow, bDrawFullShadowRectangle, bTop, bBottom, true, true); +} + +/************************************************************************* +|* |* SwFrm::PaintBorderLine() |* |*************************************************************************/ @@ -4780,6 +4835,16 @@ void PaintCharacterBorder( break; } + // Paint shadow (reduce painting rect) + { + const SvxShadowItem aShadow( + 0, &rFont.GetShadowColor(), rFont.GetShadowWidth(), + rFont.GetAbsShadowLocation(bVerticalLayout)); + + lcl_PaintShadow( SwRect(aAlignedRect), aAlignedRect, aShadow, + false, bTop, bBottom, bLeft, bRight); + } + // Init borders, after this initialization top, bottom, right and left means the // absolute position const boost::optional<editeng::SvxBorderLine> aTopBorder = @@ -4791,7 +4856,6 @@ void PaintCharacterBorder( const boost::optional<editeng::SvxBorderLine> aRightBorder = (bRight ? rFont.GetAbsRightBorder(bVerticalLayout) : boost::none); - if( aTopBorder ) { Point aLeftTop( diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx index 24c5f918325b..393174b4900a 100644 --- a/sw/source/core/text/atrhndl.hxx +++ b/sw/source/core/text/atrhndl.hxx @@ -21,7 +21,7 @@ #define _ATRHNDL_HXX #define INITIAL_NUM_ATTR 3 -#define NUM_ATTRIBUTE_STACKS 41 +#define NUM_ATTRIBUTE_STACKS 42 #include <txatbase.hxx> #include <swfntcch.hxx> diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx index 28973032e025..0e3df3ce7f10 100644 --- a/sw/source/core/text/atrstck.cxx +++ b/sw/source/core/text/atrstck.cxx @@ -43,6 +43,7 @@ #include <editeng/twolinesitem.hxx> #include <editeng/charhiddenitem.hxx> #include <editeng/boxitem.hxx> +#include <editeng/shaditem.hxx> #include <viewopt.hxx> #include <charfmt.hxx> #include <fchrfmt.hxx> @@ -113,16 +114,20 @@ const sal_uInt8 StackPos[ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) - 35, // RES_CHRATR_OVERLINE, // 38 0, // RES_CHRATR_RSID, // 39 36, // RES_CHRATR_BOX, // 40 - 37, // RES_TXTATR_REFMARK, // 41 - 38, // RES_TXTATR_TOXMARK, // 42 - 39, // RES_TXTATR_META, // 43 - 39, // RES_TXTATR_METAFIELD, // 44 - 0, // RES_TXTATR_AUTOFMT, // 45 - 0, // RES_TXTATR_INETFMT // 46 - 0, // RES_TXTATR_CHARFMT, // 47 - 40, // RES_TXTATR_CJK_RUBY, // 48 - 0, // RES_TXTATR_UNKNOWN_CONTAINER, // 49 - 0, // RES_TXTATR_DUMMY5 // 50 + 37, // RES_CHRATR_SHADOW, // 41 + 0, // RES_CHRATR_DUMMY1, // 42 + 0, // RES_CHRATR_DUMMY2, // 43 + 0, // RES_CHRATR_DUMMY3, // 44 + 38, // RES_TXTATR_REFMARK, // 45 + 39, // RES_TXTATR_TOXMARK, // 46 + 40, // RES_TXTATR_META, // 47 + 40, // RES_TXTATR_METAFIELD, // 48 + 0, // RES_TXTATR_AUTOFMT, // 49 + 0, // RES_TXTATR_INETFMT // 50 + 0, // RES_TXTATR_CHARFMT, // 51 + 41, // RES_TXTATR_CJK_RUBY, // 52 + 0, // RES_TXTATR_UNKNOWN_CONTAINER, // 53 + 0, // RES_TXTATR_DUMMY5 // 54 }; /************************************************************************* @@ -757,6 +762,14 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu rFnt.SetLeftBorderDist( aBoxItem.GetDistance(BOX_LINE_LEFT) ); break; } + case RES_CHRATR_SHADOW: + { + const SvxShadowItem& aShadowItem = static_cast<const SvxShadowItem&>(rItem); + rFnt.SetShadowColor( aShadowItem.GetColor() ); + rFnt.SetShadowWidth( aShadowItem.GetWidth() ); + rFnt.SetShadowLocation( aShadowItem.GetLocation() ); + break; + } case RES_CHRATR_OVERLINE : rFnt.SetOverline( ((SvxOverlineItem&)rItem).GetLineStyle() ); rFnt.SetOverColor( ((SvxOverlineItem&)rItem).GetColor() ); diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 2af2b3dca2c0..75085e18ee81 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -30,6 +30,7 @@ #include <editeng/splwrap.hxx> #include <editeng/pgrditem.hxx> #include <editeng/tstpitem.hxx> +#include <editeng/shaditem.hxx> #include <xmloff/odffields.hxx> #include <SwSmartTagMgr.hxx> @@ -689,7 +690,8 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo } void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor, - SwRect* pRect, SwRect* pIntersect ) const + SwRect* pRect, SwRect* pIntersect, + const bool bInsideBox ) const { Size aSize( rPor.Width(), rPor.Height() ); if( rPor.IsHangingPortion() ) @@ -746,6 +748,19 @@ void SwTxtPaintInfo::CalcRect( const SwLinePortion& rPor, if ( GetTxtFrm()->IsVertical() ) GetTxtFrm()->SwitchHorizontalToVertical( aRect ); + if( bInsideBox && rPor.InTxtGrp() ) + { + const bool bJoinWithPrev = + static_cast<const SwTxtPortion&>(rPor).GetJoinBorderWithPrev(); + const bool bJoinWithNext = + static_cast<const SwTxtPortion&>(rPor).GetJoinBorderWithNext(); + const bool bIsVert = GetTxtFrm()->IsVertical(); + aRect.Top(aRect.Top() + GetFont()->CalcShadowSpace(SHADOW_TOP, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Bottom(aRect.Bottom() - GetFont()->CalcShadowSpace(SHADOW_BOTTOM, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Left(aRect.Left() + GetFont()->CalcShadowSpace(SHADOW_LEFT, bIsVert, bJoinWithPrev, bJoinWithNext )); + aRect.Right(aRect.Right() - GetFont()->CalcShadowSpace(SHADOW_RIGHT, bIsVert, bJoinWithPrev, bJoinWithNext )); + } + if ( pRect ) *pRect = aRect; @@ -1065,7 +1080,7 @@ void SwTxtPaintInfo::DrawBackground( const SwLinePortion &rPor ) const OSL_ENSURE( OnWin(), "SwTxtPaintInfo::DrawBackground: printer pollution ?" ); SwRect aIntersect; - CalcRect( rPor, 0, &aIntersect ); + CalcRect( rPor, 0, &aIntersect, true ); if ( aIntersect.HasArea() ) { @@ -1092,7 +1107,7 @@ void SwTxtPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const { { SwRect aIntersect; - CalcRect( rPor, &aIntersect, 0 ); + CalcRect( rPor, &aIntersect, 0, true ); if(aIntersect.HasArea()) { SwTxtNode *pNd = m_pFrm->GetTxtNode(); @@ -1150,7 +1165,7 @@ void SwTxtPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const OSL_ENSURE( m_pFnt->GetBackColor(), "DrawBackBrush: Lost Color" ); SwRect aIntersect; - CalcRect( rPor, 0, &aIntersect ); + CalcRect( rPor, 0, &aIntersect, true ); if ( aIntersect.HasArea() ) { diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx index d682c8bf9ac1..f9963d598bac 100644 --- a/sw/source/core/text/inftxt.hxx +++ b/sw/source/core/text/inftxt.hxx @@ -447,7 +447,16 @@ public: inline void NotifyURL( const SwLinePortion &rPor ) const { if( URLNotify() ) _NotifyURL( rPor ); } - void CalcRect( const SwLinePortion& rPor, SwRect* pRect, SwRect* pIntersect = 0 ) const; + /** + * Calculate the rectangular area where the portion takes place. + * @param[in] rPor portion for which the method specify the painting area + * @param[out] pRect whole area of the portion + * @param[out] pIntersect part of the portion area clipped by OutputDevice's clip region + * @param[in] bInsideBox area of portion's content, padding and border, but shadow + * is excluded (e.g. for background) + **/ + void CalcRect( const SwLinePortion& rPor, SwRect* pRect, + SwRect* pIntersect = 0, const bool bInsideBox = false ) const; inline SwTwips GetPaintOfst() const; inline void SetPaintOfst( const SwTwips nNew ); diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 97929cd45c9d..ef2cbc5d56e6 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2866,7 +2866,10 @@ namespace { rFirst.GetBottomBorderDist() == rSecond.GetBottomBorderDist() && rFirst.GetLeftBorderDist() == rSecond.GetLeftBorderDist() && rFirst.GetRightBorderDist() == rSecond.GetRightBorderDist() && - rFirst.GetOrientation() == rSecond.GetOrientation(); + rFirst.GetOrientation() == rSecond.GetOrientation() && + rFirst.GetShadowColor() == rSecond.GetShadowColor() && + rFirst.GetShadowWidth() == rSecond.GetShadowWidth() && + rFirst.GetShadowLocation() == rSecond.GetShadowLocation(); } } //end unnamed namespace diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 4c2f970e934f..61fdabe99e6b 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -49,6 +49,7 @@ #include <editeng/twolinesitem.hxx> #include <editeng/charhiddenitem.hxx> #include <editeng/boxitem.hxx> +#include <editeng/shaditem.hxx> #include <IDocumentSettingAccess.hxx> #include <vcl/window.hxx> #include <charatr.hxx> @@ -225,6 +226,148 @@ SwFont::GetAbsRightBorder( const bool bVertLayout ) const } } +SvxShadowLocation SwFont::GetAbsShadowLocation( const bool bVertLayout ) const +{ + SvxShadowLocation aLocation = SVX_SHADOW_NONE; + switch( GetOrientation( bVertLayout ) ) + { + case 0: + aLocation = m_aShadowLocation; + break; + + case 900: + switch ( m_aShadowLocation ) + { + case SVX_SHADOW_TOPLEFT: + aLocation = SVX_SHADOW_BOTTOMLEFT; + break; + case SVX_SHADOW_TOPRIGHT: + aLocation = SVX_SHADOW_TOPLEFT; + break; + case SVX_SHADOW_BOTTOMLEFT: + aLocation = SVX_SHADOW_BOTTOMRIGHT; + break; + case SVX_SHADOW_BOTTOMRIGHT: + aLocation = SVX_SHADOW_TOPRIGHT; + break; + case SVX_SHADOW_NONE: + case SVX_SHADOW_END: + aLocation = m_aShadowLocation; + break; + } + break; + + case 1800: + switch ( m_aShadowLocation ) + { + case SVX_SHADOW_TOPLEFT: + aLocation = SVX_SHADOW_BOTTOMRIGHT; + break; + case SVX_SHADOW_TOPRIGHT: + aLocation = SVX_SHADOW_BOTTOMLEFT; + break; + case SVX_SHADOW_BOTTOMLEFT: + aLocation = SVX_SHADOW_TOPRIGHT; + break; + case SVX_SHADOW_BOTTOMRIGHT: + aLocation = SVX_SHADOW_TOPLEFT; + break; + case SVX_SHADOW_NONE: + case SVX_SHADOW_END: + aLocation = m_aShadowLocation; + break; + } + break; + + case 2700: + switch ( m_aShadowLocation ) + { + case SVX_SHADOW_TOPLEFT: + aLocation = SVX_SHADOW_TOPRIGHT; + break; + case SVX_SHADOW_TOPRIGHT: + aLocation = SVX_SHADOW_BOTTOMRIGHT; + break; + case SVX_SHADOW_BOTTOMLEFT: + aLocation = SVX_SHADOW_TOPLEFT; + break; + case SVX_SHADOW_BOTTOMRIGHT: + aLocation = SVX_SHADOW_BOTTOMLEFT; + break; + case SVX_SHADOW_NONE: + case SVX_SHADOW_END: + aLocation = m_aShadowLocation; + break; + } + break; + + default: + assert(false); + break; + } + return aLocation; +} + +sal_uInt16 SwFont::CalcShadowSpace( + const sal_uInt16 nShadow, const bool bVertLayout, + const bool bSkipLeft, const bool bSkipRight ) const +{ + sal_uInt16 nSpace = 0; + const sal_uInt16 nOrient = GetOrientation( bVertLayout ); + const SvxShadowLocation aLoc = GetAbsShadowLocation( bVertLayout ); + switch( nShadow ) + { + case SHADOW_TOP: + if(( aLoc == SVX_SHADOW_TOPLEFT || + aLoc == SVX_SHADOW_TOPRIGHT ) && + ( nOrient == 0 || nOrient == 1800 || + ( nOrient == 900 && !bSkipRight ) || + ( nOrient == 2700 && !bSkipLeft ))) + { + nSpace = m_nShadowWidth; + } + break; + + case SHADOW_BOTTOM: + if(( aLoc == SVX_SHADOW_BOTTOMLEFT || + aLoc == SVX_SHADOW_BOTTOMRIGHT ) && + ( nOrient == 0 || nOrient == 1800 || + ( nOrient == 900 && !bSkipLeft ) || + ( nOrient == 2700 && !bSkipRight ))) + { + nSpace = m_nShadowWidth; + } + break; + + case SHADOW_LEFT: + if(( aLoc == SVX_SHADOW_TOPLEFT || + aLoc == SVX_SHADOW_BOTTOMLEFT ) && + ( nOrient == 900 || nOrient == 2700 || + ( nOrient == 0 && !bSkipLeft ) || + ( nOrient == 1800 && !bSkipRight ))) + { + nSpace = m_nShadowWidth; + } + break; + + case SHADOW_RIGHT: + if(( aLoc == SVX_SHADOW_TOPRIGHT || + aLoc == SVX_SHADOW_BOTTOMRIGHT ) && + ( nOrient == 900 || nOrient == 2700 || + ( nOrient == 0 && !bSkipRight ) || + ( nOrient == 1800 && !bSkipLeft ))) + { + nSpace = m_nShadowWidth; + } + break; + default: + assert(false); + break; + } + + return nSpace; +} + // maps directions for vertical layout sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat ) { @@ -353,8 +496,6 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, delete pBackColor; pBackColor = NULL; - RemoveBorders(); - if( pAttrSet ) { const SfxPoolItem* pItem; @@ -546,6 +687,14 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, SetRightBorderDist(pBoxItem->GetDistance(BOX_LINE_RIGHT)); SetLeftBorderDist(pBoxItem->GetDistance(BOX_LINE_LEFT)); } + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOW, + sal_True, &pItem )) + { + const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem); + SetShadowColor(pShadowItem->GetColor()); + SetShadowWidth(pShadowItem->GetWidth()); + SetShadowLocation(pShadowItem->GetLocation()); + } const SfxPoolItem* pTwoLinesItem = 0; if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, sal_True, &pTwoLinesItem )) @@ -573,6 +722,9 @@ SwFont::SwFont() , m_nBottomBorderDist(0) , m_nRightBorderDist(0) , m_nLeftBorderDist(0) + , m_aShadowColor(COL_TRANSPARENT) + , m_nShadowWidth(0) + , m_aShadowLocation(SVX_SHADOW_NONE) , nActual(SW_LATIN) { } @@ -592,6 +744,9 @@ SwFont::SwFont( const SwFont &rFont ) m_nBottomBorderDist = rFont.m_nBottomBorderDist; m_nRightBorderDist = rFont.m_nRightBorderDist; m_nLeftBorderDist = rFont.m_nLeftBorderDist; + m_aShadowColor = rFont.m_aShadowColor; + m_nShadowWidth = rFont.m_nShadowWidth; + m_aShadowLocation = rFont.m_aShadowLocation; aUnderColor = rFont.GetUnderColor(); aOverColor = rFont.GetOverColor(); nToxCnt = 0; @@ -727,7 +882,31 @@ SwFont::SwFont( const SwAttrSet* pAttrSet, SetLeftBorderDist(pBoxItem->GetDistance(BOX_LINE_LEFT)); } else - RemoveBorders(); + { + SetTopBorder(0); + SetBottomBorder(0); + SetRightBorder(0); + SetLeftBorder(0); + SetTopBorderDist(0); + SetBottomBorderDist(0); + SetRightBorderDist(0); + SetLeftBorderDist(0); + } + + if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_SHADOW, + sal_True, &pItem )) + { + const SvxShadowItem* pShadowItem = static_cast<const SvxShadowItem*>(pItem); + SetShadowColor(pShadowItem->GetColor()); + SetShadowWidth(pShadowItem->GetWidth()); + SetShadowLocation(pShadowItem->GetLocation()); + } + else + { + SetShadowColor(COL_TRANSPARENT); + SetShadowWidth(0); + SetShadowLocation(SVX_SHADOW_NONE); + } const SvxTwoLinesItem& rTwoLinesItem = pAttrSet->Get2Lines(); if ( ! rTwoLinesItem.GetValue() ) @@ -776,6 +955,9 @@ SwFont& SwFont::operator=( const SwFont &rFont ) m_nBottomBorderDist = rFont.m_nBottomBorderDist; m_nRightBorderDist = rFont.m_nRightBorderDist; m_nLeftBorderDist = rFont.m_nLeftBorderDist; + m_aShadowColor = rFont.m_aShadowColor; + m_nShadowWidth = rFont.m_nShadowWidth; + m_aShadowLocation = rFont.m_aShadowLocation; aUnderColor = rFont.GetUnderColor(); aOverColor = rFont.GetOverColor(); nToxCnt = 0; diff --git a/sw/source/core/unocore/unomap.cxx b/sw/source/core/unocore/unomap.cxx index d9e56b2b4619..c875dcc587ca 100644 --- a/sw/source/core/unocore/unomap.cxx +++ b/sw/source/core/unocore/unomap.cxx @@ -213,6 +213,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { SW_PROP_NMID(UNO_NAME_CHAR_RIGHT_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },\ { SW_PROP_NMID(UNO_NAME_CHAR_TOP_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, TOP_BORDER_DISTANCE |CONVERT_TWIPS },\ { SW_PROP_NMID(UNO_NAME_CHAR_BOTTOM_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PropertyAttribute::MAYBEVOID, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },\ + { SW_PROP_NMID(UNO_NAME_CHAR_SHADOW_FORMAT), RES_CHRATR_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PropertyAttribute::MAYBEVOID, CONVERT_TWIPS},\ { SW_PROP_NMID(UNO_NAME_LEFT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), PropertyAttribute::MAYBEVOID, LEFT_BORDER |CONVERT_TWIPS }, \ { SW_PROP_NMID(UNO_NAME_RIGHT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), PropertyAttribute::MAYBEVOID, RIGHT_BORDER |CONVERT_TWIPS }, \ { SW_PROP_NMID(UNO_NAME_TOP_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), PropertyAttribute::MAYBEVOID, TOP_BORDER |CONVERT_TWIPS }, \ @@ -446,6 +447,7 @@ SwUnoPropertyMapProvider::~SwUnoPropertyMapProvider() { SW_PROP_NMID(UNO_NAME_CHAR_RIGHT_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32),PROPERTY_NONE, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS },\ { SW_PROP_NMID(UNO_NAME_CHAR_TOP_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, TOP_BORDER_DISTANCE |CONVERT_TWIPS },\ { SW_PROP_NMID(UNO_NAME_CHAR_BOTTOM_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS },\ + { SW_PROP_NMID(UNO_NAME_CHAR_SHADOW_FORMAT), RES_CHRATR_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS},\ { SW_PROP_NMID(UNO_NAME_LEFT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, LEFT_BORDER |CONVERT_TWIPS },\ { SW_PROP_NMID(UNO_NAME_RIGHT_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, RIGHT_BORDER |CONVERT_TWIPS },\ { SW_PROP_NMID(UNO_NAME_TOP_BORDER), RES_BOX, CPPU_E2T(CPPUTYPE_BORDERLINE), 0, TOP_BORDER |CONVERT_TWIPS },\ @@ -601,6 +603,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_CHAR_RIGHT_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS }, { SW_PROP_NMID(UNO_NAME_CHAR_TOP_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, TOP_BORDER_DISTANCE |CONVERT_TWIPS }, { SW_PROP_NMID(UNO_NAME_CHAR_BOTTOM_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS }, + { SW_PROP_NMID(UNO_NAME_CHAR_SHADOW_FORMAT), RES_CHRATR_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS}, {0,0,0,0,0,0} }; aMapEntriesArr[nPropertyId] = aCharStyleMap; @@ -659,6 +662,7 @@ const SfxItemPropertyMapEntry* SwUnoPropertyMapProvider::GetPropertyMapEntries(s { SW_PROP_NMID(UNO_NAME_CHAR_RIGHT_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, RIGHT_BORDER_DISTANCE |CONVERT_TWIPS }, { SW_PROP_NMID(UNO_NAME_CHAR_TOP_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, TOP_BORDER_DISTANCE |CONVERT_TWIPS }, { SW_PROP_NMID(UNO_NAME_CHAR_BOTTOM_BORDER_DISTANCE), RES_CHRATR_BOX, CPPU_E2T(CPPUTYPE_INT32), PROPERTY_NONE, BOTTOM_BORDER_DISTANCE|CONVERT_TWIPS }, + { SW_PROP_NMID(UNO_NAME_CHAR_SHADOW_FORMAT), RES_CHRATR_SHADOW, CPPU_E2T(CPPUTYPE_SHADOWFMT), PROPERTY_NONE, CONVERT_TWIPS}, {0,0,0,0,0,0} }; aMapEntriesArr[nPropertyId] = aAutoCharStyleMap; diff --git a/sw/source/core/unocore/unoprnms.cxx b/sw/source/core/unocore/unoprnms.cxx index 39e691fd0a95..6dbbc4d2e198 100644 --- a/sw/source/core/unocore/unoprnms.cxx +++ b/sw/source/core/unocore/unoprnms.cxx @@ -801,6 +801,7 @@ const SwPropNameTab aPropNameTab = { /* 0769 UNO_NAME_CHAR_RIGHT_BORDER_DISTANCE */ {MAP_CHAR_LEN("CharRightBorderDistance")}, /* 0770 UNO_NAME_CHAR_TOP_BORDER_DISTANCE */ {MAP_CHAR_LEN("CharTopBorderDistance")}, /* 0771 UNO_NAME_CHAR_BOTTOM_BORDER_DISTANCE */ {MAP_CHAR_LEN("CharBottomBorderDistance")}, +/* 0771 UNO_NAME_CHAR_SHADOW_FORMAT */ {MAP_CHAR_LEN("CharShadowFormat")}, // new items in this array must match enum SwPropNameIds diff --git a/sw/source/core/unocore/unosrch.cxx b/sw/source/core/unocore/unosrch.cxx index bc728f43a10f..bacc481a2957 100644 --- a/sw/source/core/unocore/unosrch.cxx +++ b/sw/source/core/unocore/unosrch.cxx @@ -169,7 +169,8 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea *pFontSizeCTLItem = 0, *pCTLLangItem = 0, *pCTLPostureItem = 0, - *pCTLWeightItem = 0; + *pCTLWeightItem = 0, + *pShadowItem = 0; PropertyEntryVector_t::const_iterator aIt = aPropertyEntries.begin(); for(sal_uInt32 i = 0; i < nArrLen; i++, ++aIt) @@ -409,6 +410,11 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea pCTLWeightItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); pTempItem = pCTLWeightItem; break; + case RES_CHRATR_SHADOW: + if(!pShadowItem ) + pShadowItem = rSet.GetPool()->GetDefaultItem(aIt->nWID).Clone(); + pTempItem = pShadowItem; + break; } if(pTempItem) { @@ -458,6 +464,7 @@ void SwSearchProperties_Impl::FillItemSet(SfxItemSet& rSet, sal_Bool bIsValueSea delete pCharColorItem; delete pCasemapItem ; delete pBrushItem ; + delete pShadowItem; } sal_Bool SwSearchProperties_Impl::HasAttributes() const diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx index f0f8fba5c0b7..bd77d3c65fd4 100644 --- a/sw/source/filter/html/css1atr.cxx +++ b/sw/source/filter/html/css1atr.cxx @@ -3640,6 +3640,10 @@ SwAttrFnTab aCSS1AttrFnTab = { /* RES_CHRATR_OVERLINE */ OutCSS1_SvxOverline, /* RES_CHRATR_RSID */ 0, /* RES_CHRATR_BOX */ 0, +/* RES_CHRATR_SHADOW */ 0, +/* RES_CHRATR_DUMMY1 */ 0, +/* RES_CHRATR_DUMMY2 */ 0, +/* RES_CHRATR_DUMMY3 */ 0, /* RES_TXTATR_REFMARK */ 0, /* RES_TXTATR_TOXMARK */ 0, diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index 5ae4128cb58f..f2b7615542e6 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -3228,6 +3228,10 @@ SwAttrFnTab aHTMLAttrFnTab = { /* RES_CHRATR_OVERLINE */ OutHTML_CSS1Attr, /* RES_CHRATR_RSID */ 0, /* RES_CHRATR_BOX */ 0, +/* RES_CHRATR_SHADOW */ 0, +/* RES_CHRATR_DUMMY1 */ 0, +/* RES_CHRATR_DUMMY2 */ 0, +/* RES_CHRATR_DUMMY3 */ 0, /* RES_TXTATR_REFMARK */ 0, /* RES_TXTATR_TOXMARK */ 0, diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx index 52ada496a142..490f0e9fa8a0 100644 --- a/sw/source/ui/shells/textsh1.cxx +++ b/sw/source/ui/shells/textsh1.cxx @@ -140,6 +140,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const RES_TXTATR_INETFMT, RES_TXTATR_INETFMT, RES_BACKGROUND, RES_BACKGROUND, RES_BOX, RES_BOX, + RES_SHADOW, RES_SHADOW, SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER, FN_PARAM_SELECTION, FN_PARAM_SELECTION, SID_HTML_MODE, SID_HTML_MODE, diff --git a/sw/source/ui/utlui/uitool.cxx b/sw/source/ui/utlui/uitool.cxx index 862a9544a442..455e738cc9e4 100644 --- a/sw/source/ui/utlui/uitool.cxx +++ b/sw/source/ui/utlui/uitool.cxx @@ -32,6 +32,7 @@ #include <editeng/pmdlitem.hxx> #include <editeng/tstpitem.hxx> #include <editeng/boxitem.hxx> +#include <editeng/shaditem.hxx> #include <editeng/sizeitem.hxx> #include <editeng/brushitem.hxx> #include <svx/pageitem.hxx> @@ -133,18 +134,28 @@ void ConvertAttrCharToGen(SfxItemSet& rSet, sal_uInt8 nMode) rSet.ClearItem(RES_BACKGROUND); } - // Border if( nMode == CONV_ATTR_STD ) { - const SfxPoolItem *pTmpBox; - if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_BOX, sal_True, &pTmpBox ) ) + // Border + const SfxPoolItem *pTmpItem; + if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_BOX, sal_True, &pTmpItem ) ) { - SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) ); + SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpItem) ); aTmpBox.SetWhich( RES_BOX ); rSet.Put( aTmpBox ); } else rSet.ClearItem(RES_BOX); + + // Border shadow + if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_SHADOW, sal_False, &pTmpItem ) ) + { + SvxShadowItem aTmpShadow( *((SvxShadowItem*)pTmpItem) ); + aTmpShadow.SetWhich( RES_SHADOW ); + rSet.Put( aTmpShadow ); + } + else + rSet.ClearItem( RES_SHADOW ); } } @@ -162,17 +173,26 @@ void ConvertAttrGenToChar(SfxItemSet& rSet, sal_uInt8 nMode) rSet.ClearItem( RES_BACKGROUND ); } - // Border if( nMode == CONV_ATTR_STD ) { - const SfxPoolItem *pTmpBox; - if( SFX_ITEM_SET == rSet.GetItemState( RES_BOX, sal_False, &pTmpBox ) ) + // Border + const SfxPoolItem *pTmpItem; + if( SFX_ITEM_SET == rSet.GetItemState( RES_BOX, sal_False, &pTmpItem ) ) { - SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) ); + SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpItem) ); aTmpBox.SetWhich( RES_CHRATR_BOX ); rSet.Put( aTmpBox ); } rSet.ClearItem( RES_BOX ); + + // Border shadow + if( SFX_ITEM_SET == rSet.GetItemState( RES_SHADOW, sal_False, &pTmpItem ) ) + { + SvxShadowItem aTmpShadow( *((SvxShadowItem*)pTmpItem) ); + aTmpShadow.SetWhich( RES_CHRATR_SHADOW ); + rSet.Put( aTmpShadow ); + } + rSet.ClearItem( RES_SHADOW ); } } diff --git a/xmloff/source/text/txtprmap.cxx b/xmloff/source/text/txtprmap.cxx index 64430eeee9fb..00be1ae86b7f 100644 --- a/xmloff/source/text/txtprmap.cxx +++ b/xmloff/source/text/txtprmap.cxx @@ -238,6 +238,8 @@ XMLPropertyMapEntry aXMLParaPropMap[] = MT_EV( "CharRightBorder", FO, BORDER_RIGHT, XML_TYPE_BORDER, CTF_CHARRIGHTBORDER, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), MT_EV( "CharTopBorder", FO, BORDER_TOP, XML_TYPE_BORDER, CTF_CHARTOPBORDER, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), MT_EV( "CharBottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_CHARBOTTOMBORDER, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), + // RES_CHRATR_SHADOW + MT_EV( "CharShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), // RES_TXTATR_INETFMT // TODO // RES_TXTATR_REFMARK @@ -562,6 +564,8 @@ XMLPropertyMapEntry aXMLTextPropMap[] = MT_EV( "CharRightBorder", FO, BORDER_RIGHT, XML_TYPE_BORDER, CTF_CHARRIGHTBORDER, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), MT_EV( "CharTopBorder", FO, BORDER_TOP, XML_TYPE_BORDER, CTF_CHARTOPBORDER, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), MT_EV( "CharBottomBorder", FO, BORDER_BOTTOM, XML_TYPE_BORDER, CTF_CHARBOTTOMBORDER, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), + // RES_CHRATR_SHADOW + MT_EV( "CharShadowFormat", STYLE, SHADOW, XML_TYPE_TEXT_SHADOW, 0, SvtSaveOptions::ODFVER_012_EXT_COMPAT ), // RES_TXTATR_INETFMT MT_E( "HyperLinkURL", TEXT, XMLNS, XML_TYPE_STRING|MID_FLAG_NO_PROPERTY_IMPORT, CTF_HYPERLINK_URL ), // RES_TXTATR_REFMARK |