[Libreoffice-commits] core.git: 9 commits - include/xmloff offapi/com qadevOOo/objdsc sw/inc sw/qa sw/source xmloff/source

Zolnai Tamás zolnaitamas2000 at gmail.com
Fri Aug 23 12:02:10 PDT 2013


 include/xmloff/xmltoken.hxx                                        |    1 
 offapi/com/sun/star/style/CharacterProperties.idl                  |    7 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXCellRange.csv       |    1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextCursor.csv      |    1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextRange.csv       |    1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextTableCursor.csv |    1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXTextViewCursor.csv  |    1 
 qadevOOo/objdsc/sw/com.sun.star.style.CharacterStyle.csv           |    1 
 sw/inc/charatr.hxx                                                 |    4 
 sw/inc/format.hxx                                                  |    1 
 sw/inc/hintids.hxx                                                 |  218 ++---
 sw/inc/swatrset.hxx                                                |    6 
 sw/inc/unoprnms.hxx                                                |    3 
 sw/qa/extras/odfexport/data/charborder.odt                         |binary
 sw/qa/extras/odfexport/odfexport.cxx                               |   24 
 sw/source/core/attr/swatrset.cxx                                   |    1 
 sw/source/core/bastyp/init.cxx                                     |   20 
 sw/source/core/doc/dbgoutsw.cxx                                    |    1 
 sw/source/core/inc/frmtool.hxx                                     |    4 
 sw/source/core/inc/swfntcch.hxx                                    |    2 
 sw/source/core/inc/swfont.hxx                                      |  112 ++
 sw/source/core/layout/paintfrm.cxx                                 |  422 ++++++----
 sw/source/core/text/atrhndl.hxx                                    |    2 
 sw/source/core/text/atrstck.cxx                                    |   33 
 sw/source/core/text/guess.cxx                                      |   29 
 sw/source/core/text/inftxt.cxx                                     |   89 --
 sw/source/core/text/inftxt.hxx                                     |   31 
 sw/source/core/text/itrcrsr.cxx                                    |   11 
 sw/source/core/text/itrform2.cxx                                   |   36 
 sw/source/core/text/pordrop.hxx                                    |    9 
 sw/source/core/text/porfld.cxx                                     |    5 
 sw/source/core/text/portxt.cxx                                     |   26 
 sw/source/core/text/txtdrop.cxx                                    |   20 
 sw/source/core/txtnode/swfont.cxx                                  |  200 ++++
 sw/source/core/unocore/unomap.cxx                                  |    4 
 sw/source/core/unocore/unoprnms.cxx                                |    1 
 sw/source/core/unocore/unosrch.cxx                                 |    9 
 sw/source/filter/html/css1atr.cxx                                  |    4 
 sw/source/filter/html/htmlatr.cxx                                  |    4 
 sw/source/ui/app/docst.cxx                                         |    2 
 sw/source/ui/shells/textsh1.cxx                                    |    2 
 sw/source/ui/utlui/uitool.cxx                                      |   36 
 xmloff/source/core/xmltoken.cxx                                    |    1 
 xmloff/source/style/bordrhdl.cxx                                   |    5 
 xmloff/source/text/txtprmap.cxx                                    |    4 
 45 files changed, 964 insertions(+), 431 deletions(-)

New commits:
commit fa94ca9a84e12128fcd4a5aea1823ca5fd5b997a
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Aug 22 12:34:37 2013 +0200

    ODF export/import of fine dashed border style
    
    Change-Id: Ia81385dd9952e90cd5ebb3d1bba38aff6f84d079

diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index 51522f1..f6ecd59 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -763,6 +763,7 @@ namespace xmloff { namespace token {
         XML_FILTER_OPTIONS,
         XML_FILTER_OR,
         XML_FILTER_SET_ITEM,
+        XML_FINE_DASHED,
         XML_FIRST_DATE_TIME,
         XML_FIRST_PAGE,
         XML_FIRST_PAGE_NUMBER,
diff --git a/sw/qa/extras/odfexport/data/charborder.odt b/sw/qa/extras/odfexport/data/charborder.odt
index 8395625..6794c50 100644
Binary files a/sw/qa/extras/odfexport/data/charborder.odt and b/sw/qa/extras/odfexport/data/charborder.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index b838312..0ad7743 100644
--- a/sw/qa/extras/odfexport/odfexport.cxx
+++ b/sw/qa/extras/odfexport/odfexport.cxx
@@ -288,7 +288,7 @@ void Test::testCharacterBorder()
 
         table::BorderLine2 aBorderArray[4] =
         {
-            table::BorderLine2(16724787,26,2,4,13,35),     // Top
+            table::BorderLine2(16724787,0,37,0,14,37),     // Top (fine dashed line)
             table::BorderLine2(10092390,26,26,53,11,106),  // Bottom
             table::BorderLine2(6711039,9,26,9,12,71),      // Left
             table::BorderLine2(0,0,0,0,0,0)                // Right
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index ac3d095..92701ba 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -767,6 +767,7 @@ namespace xmloff { namespace token {
         TOKEN( "filter-options",                  XML_FILTER_OPTIONS ),
         TOKEN( "filter-or",                       XML_FILTER_OR ),
         TOKEN( "filter-set-item",                 XML_FILTER_SET_ITEM ),
+        TOKEN( "fine-dashed",                     XML_FINE_DASHED ),
         TOKEN( "first-date-time",                 XML_FIRST_DATE_TIME ),
         TOKEN( "first-page",                      XML_FIRST_PAGE ),
         TOKEN( "first-page-number",               XML_FIRST_PAGE_NUMBER ),
diff --git a/xmloff/source/style/bordrhdl.cxx b/xmloff/source/style/bordrhdl.cxx
index 530441e..4e96eb0 100644
--- a/xmloff/source/style/bordrhdl.cxx
+++ b/xmloff/source/style/bordrhdl.cxx
@@ -42,6 +42,7 @@ const sal_uInt16 API_LINE_EMBOSSED  = 10;
 const sal_uInt16 API_LINE_ENGRAVED  = 11;
 const sal_uInt16 API_LINE_OUTSET  = 12;
 const sal_uInt16 API_LINE_INSET  = 13;
+const sal_uInt16 API_LINE_FINE_DASHED  = 14;
 const sal_uInt16 API_LINE_NONE = USHRT_MAX;
 
 #define DEF_LINE_WIDTH_0        1
@@ -64,6 +65,7 @@ SvXMLEnumMapEntry pXML_BorderStyles[] =
     { XML_RIDGE,                API_LINE_EMBOSSED },
     { XML_INSET,                API_LINE_INSET  },
     { XML_OUTSET,               API_LINE_OUTSET },
+    { XML_FINE_DASHED,          API_LINE_FINE_DASHED },
     { XML_TOKEN_INVALID,        0 }
 };
 
@@ -334,6 +336,9 @@ sal_Bool XMLBorderHdl::exportXML( OUString& rStrExpValue, const uno::Any& rValue
             case API_LINE_INSET:
                 eStyleToken = XML_INSET;
                 break;
+            case API_LINE_FINE_DASHED:
+                eStyleToken = XML_FINE_DASHED;
+                break;
             case API_LINE_SOLID:
             default:
                 break;
commit 16f637dab3c1b5f7ac9eacf2c57347800d3fdf09
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Fri Aug 23 11:30:17 2013 +0200

    Fix borderline primitive merge
    
    Two problems
    1, Borderlines with different styles are merged
    Steps to reproduce this bug:
    -Add solid/dotted/dashed border to the first paragraph
    -Add solid/dotted/dashed border (but different from the
    first paragraph's border) to the second paragraph.
    Result:
    Second paragraph's left and right border will have the
    same style as the first paragraph's border has. Top and bottom
    border have the expected style.
    
    2, The order of adding border lines to the BorderLines
    container can change the correctness of merge.
    The bug appaers when there is a vertical text
    range with border, consist of more text portions.
    For example: Add one border for the whole vertical text
    range, but change the background of one part of it.
    
    Change-Id: Iae6ecff31f24b232b3250c3f9d0d4ecd49fb18d4

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 9a12cc7..77a29f0 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -409,21 +409,44 @@ SwSavePaintStatics::~SwSavePaintStatics()
 
 //----------------- Implementation for the table borders --------------
 
-static pair<bool, pair<double, double> >
-lcl_TryMergeLines(pair<double, double> const mergeA,
-                  pair<double, double> const mergeB)
+/**
+ * Check whether the two primitve can be merged
+ *
+ * @param[in]   mergeA  A primitive start and end position
+ * @param[in]   mergeB  B primitive start and end position
+ * @return      1       if A and B can be merged to a primite staring with A, ending with B
+ *              2       if A and B can be merged to a primite staring with B, ending with A
+ *              0       if A and B can't be merged
+**/
+static sal_uInt8 lcl_TryMergeLines(
+    pair<double, double> const mergeA,
+    pair<double, double> const mergeB)
 {
     double const fMergeGap(nPixelSzW + nHalfPixelSzW); // NOT static!
-    if (   (mergeA.second + fMergeGap >= mergeB.first )
-        && (mergeA.first  - fMergeGap <= mergeB.second))
+    // A is above/before B
+    if( mergeA.second <= mergeB.second &&
+        mergeA.second + fMergeGap >= mergeB.first )
     {
-        return make_pair(true, make_pair(
-                                std::min(mergeA.first, mergeB.first),
-                                std::max(mergeA.second, mergeB.second)));
+        return 1;
     }
-    return make_pair(false, make_pair(0, 0));
+    // B is above/before A
+    else if( mergeB.second <= mergeA.second &&
+             mergeB.second + fMergeGap >= mergeA.first )
+    {
+        return 2;
+    }
+    return 0;
 }
 
+/**
+ * Make a new primitive from the two input borderline primitive
+ *
+ * @param[in]   rLine       starting primitive
+ * @param[in]   rOther      ending primitive
+ * @param[in]   rStart      starting point of merged primitive
+ * @param[in]   rEnd        ending point of merged primitive
+ * @return      merged primitive
+**/
 static ::rtl::Reference<BorderLinePrimitive2D>
 lcl_MergeBorderLines(
     BorderLinePrimitive2D const& rLine, BorderLinePrimitive2D const& rOther,
@@ -444,6 +467,14 @@ lcl_MergeBorderLines(
                 rLine.getStyle());
 }
 
+/**
+ * Merge the two borderline if possible.
+ *
+ * @param[in]   rThis   one borderline primitive
+ * @param[in]   rOther  other borderline primitive
+ * @return      merged borderline including the two input primitive, if they can be merged
+ *              0, otherwise
+**/
 static ::rtl::Reference<BorderLinePrimitive2D>
 lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis,
                        BorderLinePrimitive2D const& rOther)
@@ -456,33 +487,27 @@ lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis,
     double thisWidth  = rThis.getEnd().getX() - rThis.getStart().getX();
     double otherHeight = rOther.getEnd().getY() -  rOther.getStart().getY();
     double otherWidth  = rOther.getEnd().getX() -  rOther.getStart().getX();
-    // check for same orientation, same line width and matching colors
+    // check for same orientation, same line width, same style and matching colors
     if (    ((thisHeight > thisWidth) == (otherHeight > otherWidth))
         &&  (rThis.getLeftWidth()     == rOther.getLeftWidth())
         &&  (rThis.getDistance()      == rOther.getDistance())
         &&  (rThis.getRightWidth()    == rOther.getRightWidth())
+        &&  (rThis.getStyle()         == rOther.getStyle())
         &&  (rThis.getRGBColorLeft()  == rOther.getRGBColorLeft())
         &&  (rThis.getRGBColorRight() == rOther.getRGBColorRight())
         &&  (rThis.hasGapColor()      == rOther.hasGapColor())
         &&  (!rThis.hasGapColor() ||
              (rThis.getRGBColorGap()  == rOther.getRGBColorGap())))
     {
+        int nRet = 0;
         if (thisHeight > thisWidth) // vertical line
         {
             if (rThis.getStart().getX() == rOther.getStart().getX())
             {
                 assert(rThis.getEnd().getX() == rOther.getEnd().getX());
-                pair<bool, pair<double, double> > const res = lcl_TryMergeLines(
+                nRet = lcl_TryMergeLines(
                     make_pair(rThis.getStart().getY(), rThis.getEnd().getY()),
                     make_pair(rOther.getStart().getY(),rOther.getEnd().getY()));
-                if (res.first) // merge them
-                {
-                    basegfx::B2DPoint const start(
-                            rThis.getStart().getX(), res.second.first);
-                    basegfx::B2DPoint const end(
-                            rThis.getStart().getX(), res.second.second);
-                    return lcl_MergeBorderLines(rThis, rOther, start, end);
-                }
             }
         }
         else // horizontal line
@@ -490,19 +515,30 @@ lcl_TryMergeBorderLine(BorderLinePrimitive2D const& rThis,
             if (rThis.getStart().getY() == rOther.getStart().getY())
             {
                 assert(rThis.getEnd().getY() == rOther.getEnd().getY());
-                pair<bool, pair<double, double> > const res = lcl_TryMergeLines(
+                nRet = lcl_TryMergeLines(
                     make_pair(rThis.getStart().getX(), rThis.getEnd().getX()),
                     make_pair(rOther.getStart().getX(),rOther.getEnd().getX()));
-                if (res.first) // merge them
-                {
-                    basegfx::B2DPoint const start(
-                            res.second.first, rThis.getStart().getY());
-                    basegfx::B2DPoint const end(
-                            res.second.second, rThis.getEnd().getY());
-                    return lcl_MergeBorderLines(rThis, rOther, start, end);
-                }
             }
         }
+
+        // The merged primitive starts with rThis and ends with rOther
+        if (nRet == 1)
+        {
+            basegfx::B2DPoint const start(
+                rThis.getStart().getX(), rThis.getStart().getY());
+            basegfx::B2DPoint const end(
+                rOther.getEnd().getX(), rOther.getEnd().getY());
+            return lcl_MergeBorderLines(rThis, rOther, start, end);
+        }
+        // The merged primitive starts with rOther and ends with rThis
+        else if(nRet == 2)
+        {
+            basegfx::B2DPoint const start(
+                rOther.getStart().getX(), rOther.getStart().getY());
+            basegfx::B2DPoint const end(
+                rThis.getEnd().getX(), rThis.getEnd().getY());
+            return lcl_MergeBorderLines(rOther, rThis, start, end);
+        }
     }
     return 0;
 }
commit f8b6c3949e2c1f23549a2ef879e728cdb7149235
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Aug 21 21:30:41 2013 +0200

    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

diff --git a/offapi/com/sun/star/style/CharacterProperties.idl b/offapi/com/sun/star/style/CharacterProperties.idl
index 920c55d..c4f5452 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 bbf37c1..85b06ec 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 fd964f8..1f45acc 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 2618653..7beae74 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 b2fbb91..79f86c9 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 6ecd7ca..85ab9e7 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 c7d16cd..26a0868 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 5ac0b34..b0a77c2 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 6e8ad24..2063ee3 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 37d5a39..da26031 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 7810f39..0b35135 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 7466139..aa1c7c9 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
index 9f37d58..8395625 100644
Binary files a/sw/qa/extras/odfexport/data/charborder.odt and b/sw/qa/extras/odfexport/data/charborder.odt differ
diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx
index 3a248b2..b838312 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 bdf8b00..aef8556 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 812f169..c9624f2 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 4dd024a..2a97182 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 d790581..041757a 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 82acffd..96840cf 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 d965830..9a12cc7 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 24c5f91..393174b 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 2897303..0e3df3c 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 2af2b3d..75085e1 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 d682c8b..f9963d5 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 97929cd..ef2cbc5 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 4c2f970..61fdabe 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 d9e56b2..c875dcc 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 39e691f..6dbbc4d 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 bc728f4..bacc481 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 f0f8fba..bd77d3c 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 5ae4128..f2b7615 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 52ada49..490f0e9 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 862a954..455e738 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 64430ee..00be1ae 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
commit 9509a46683e40fc2feea6631b701b766797b7882
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Aug 21 13:17:07 2013 +0200

    Use text portion's join members without changing font
    
    - The main advantage of avoiding font change and
    use join members is that part of the border can be
    removed (e.g. right or left border) but shadow won't.
    - Other advantage, SwTxtSizeInfo is used for calculate
    the length of the specified string and there are some
    case when this length have to exclude the border width.
    - Add join members to SwDropPortionPart and use these
    members to set the whole drop portion's same member.
    In general a drop portion' join members are false
    and it get true value only temporarly during the actual
    part formatting. (maybe it would be better solution to
    make distinct drop portions instead of parts)
    - Improve line break
    
    Change-Id: I6d11ec7b250c9a8b769cffaf83861f25f0c477a5

diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 4b9f638..b478f55 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -66,7 +66,9 @@ void SwAlignRect( SwRect &rRect, const ViewShell *pSh );
 void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
 
 // Paint character border using frame painting code
-void PaintCharacterBorder( const SwFont& rFont, const SwRect& rPaintArea, const bool bVerticalLayout);
+void PaintCharacterBorder(
+    const SwFont& rFont, const SwRect& rPaintArea, const bool bVerticalLayout,
+    const bool bJoinWithPrev, const bool bJoinWithNext );
 
 // get Fly, if no List is given use the current shell
 // Implementation in feshview.cxx
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b70bb16..d965830 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4748,17 +4748,49 @@ static void lcl_PaintTopBottomLine( const bool         _bTop,
 void PaintCharacterBorder(
     const SwFont& rFont,
     const SwRect& rPaintArea,
-    const bool bVerticalLayout )
+    const bool bVerticalLayout,
+    const bool bJoinWithPrev,
+    const bool bJoinWithNext )
 {
+    SwRect aAlignedRect(rPaintArea);
+    SwAlignRect(aAlignedRect, pGlobalShell);
+
+    bool bTop = true;
+    bool bBottom = true;
+    bool bLeft = true;
+    bool bRight = true;
+
+    switch( rFont.GetOrientation(bVerticalLayout) )
+    {
+        case 0 :
+            bLeft = !bJoinWithPrev;
+            bRight = !bJoinWithNext;
+            break;
+        case 900 :
+            bBottom = !bJoinWithPrev;
+            bTop = !bJoinWithNext;
+            break;
+        case 1800 :
+            bRight = !bJoinWithPrev;
+            bLeft = !bJoinWithNext;
+            break;
+        case 2700 :
+            bTop = !bJoinWithPrev;
+            bBottom = !bJoinWithNext;
+            break;
+    }
+
     // Init borders, after this initialization top, bottom, right and left means the
     // absolute position
-    const boost::optional<editeng::SvxBorderLine>& aTopBorder = rFont.GetAbsTopBorder(bVerticalLayout);
-    const boost::optional<editeng::SvxBorderLine>& aBottomBorder = rFont.GetAbsBottomBorder(bVerticalLayout);
-    const boost::optional<editeng::SvxBorderLine>& aLeftBorder = rFont.GetAbsLeftBorder(bVerticalLayout);
-    const boost::optional<editeng::SvxBorderLine>& aRightBorder = rFont.GetAbsRightBorder(bVerticalLayout);
+    const boost::optional<editeng::SvxBorderLine> aTopBorder =
+        (bTop ? rFont.GetAbsTopBorder(bVerticalLayout) : boost::none);
+    const boost::optional<editeng::SvxBorderLine> aBottomBorder =
+        (bBottom ? rFont.GetAbsBottomBorder(bVerticalLayout) : boost::none);
+    const boost::optional<editeng::SvxBorderLine> aLeftBorder =
+        (bLeft ? rFont.GetAbsLeftBorder(bVerticalLayout) : boost::none);
+    const boost::optional<editeng::SvxBorderLine> aRightBorder =
+        (bRight ? rFont.GetAbsRightBorder(bVerticalLayout) : boost::none);
 
-    SwRect aAlignedRect(rPaintArea);
-    SwAlignRect(aAlignedRect, pGlobalShell);
 
     if( aTopBorder )
     {
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 4ee643a..ae5a8ff 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -111,11 +111,11 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
         if ( nLineWidth < 0 ) nLineWidth = 0;
     }
 
-    // Decrease the line width with the right and left border width
-    if( rInf.GetFont()->GetRightBorder() )
-        nLineWidth -= rInf.GetFont()->GetRightBorderSpace();
-    if( rInf.GetFont()->GetLeftBorder() )
-        nLineWidth -= rInf.GetFont()->GetLeftBorderSpace();
+    const sal_Int32 nLeftRightBorderSpace =
+        (!rPor.GetJoinBorderWithNext() ? rInf.GetFont()->GetRightBorderSpace() : 0) +
+        (!rPor.GetJoinBorderWithPrev() ? rInf.GetFont()->GetLeftBorderSpace() : 0);
+
+    nLineWidth -= nLeftRightBorderSpace;
 
     const bool bUnbreakableNumberings = rInf.GetTxtFrm()->GetTxtNode()->
             getIDocumentSettingAccess()->get(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS);
@@ -143,6 +143,8 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
             if ( nMaxSizeDiff )
                 rInf.SetMaxWidthDiff( (sal_uLong)&rPor, nMaxSizeDiff );
 
+            nBreakWidth += nLeftRightBorderSpace;
+
             return sal_True;
         }
     }
@@ -193,6 +195,8 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
             if ( nMaxSizeDiff )
                 rInf.SetMaxWidthDiff( (sal_uLong)&rPor, nMaxSizeDiff );
 
+            nBreakWidth += nLeftRightBorderSpace;
+
             return sal_True;
         }
     }
@@ -464,6 +468,7 @@ sal_Bool SwTxtGuess::Guess( const SwTxtPortion& rPor, SwTxtFormatInfo &rInf,
             const xub_StrLen nHangingLen = nBreakPos - nCutPos;
             SwPosSize aTmpSize = rInf.GetTxtSize( &rSI, nCutPos,
                                                   nHangingLen, 0 );
+            aTmpSize.Width(aTmpSize.Width() + nLeftRightBorderSpace);

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list