[Libreoffice-commits] core.git: 8 commits - include/svx sw/inc sw/source sw/uiconfig

Zolnai Tamás zolnaitamas2000 at gmail.com
Thu Jul 25 22:17:32 PDT 2013


 include/svx/flagsdef.hxx                      |    2 
 sw/inc/charatr.hxx                            |    4 +
 sw/inc/format.hxx                             |    1 
 sw/inc/hintids.hxx                            |    4 -
 sw/inc/swabstdlg.hxx                          |    2 
 sw/inc/swatrset.hxx                           |    1 
 sw/source/core/bastyp/init.cxx                |    9 +-
 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                 |   24 ++++++-
 sw/source/core/layout/paintfrm.cxx            |   86 ++++++++++++++++++++++++--
 sw/source/core/text/atrhndl.hxx               |    2 
 sw/source/core/text/atrstck.cxx               |   21 ++++--
 sw/source/core/text/guess.cxx                 |    6 +
 sw/source/core/text/inftxt.cxx                |   84 +++++++++++++++++++++++--
 sw/source/core/text/inftxt.hxx                |   19 +----
 sw/source/core/text/itrcrsr.cxx               |   12 +++
 sw/source/core/text/itrform2.cxx              |    8 --
 sw/source/core/text/portxt.cxx                |    1 
 sw/source/core/txtnode/swfont.cxx             |   84 ++++++++++++++++++++++++-
 sw/source/filter/html/css1atr.cxx             |    2 
 sw/source/filter/html/htmlatr.cxx             |    2 
 sw/source/ui/app/docst.cxx                    |   31 +++++++++
 sw/source/ui/app/docstyle.cxx                 |   22 +++---
 sw/source/ui/chrdlg/chardlg.cxx               |   21 +++---
 sw/source/ui/dialog/swdlgfact.cxx             |    4 -
 sw/source/ui/dialog/swdlgfact.hxx             |    2 
 sw/source/ui/envelp/envfmt.cxx                |    3 
 sw/source/ui/fmtui/tmpdlg.cxx                 |    4 +
 sw/source/ui/fmtui/tmpdlg.src                 |    6 +
 sw/source/ui/inc/chrdlg.hxx                   |    7 +-
 sw/source/ui/inc/chrdlgmodes.hxx              |   21 ++++++
 sw/source/ui/shells/annotsh.cxx               |    3 
 sw/source/ui/shells/drwtxtex.cxx              |    3 
 sw/source/ui/shells/textsh1.cxx               |   32 +++++++++
 sw/uiconfig/swriter/ui/characterproperties.ui |   14 ++++
 37 files changed, 472 insertions(+), 82 deletions(-)

New commits:
commit 084b7d8e71270f90e1f41d373a2b95d4ddc18b88
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Jul 25 21:22:05 2013 +0200

    Remove some unused comment
    
    Change-Id: I1500b849d2773a62f0e9191f1acd53443867bfc7

diff --git a/include/svx/flagsdef.hxx b/include/svx/flagsdef.hxx
index e6523dd..1603ee5 100644
--- a/include/svx/flagsdef.hxx
+++ b/include/svx/flagsdef.hxx
@@ -26,8 +26,6 @@
 #define SW_BORDER_MODE_PARA     0x01
 #define SW_BORDER_MODE_TABLE    0x02
 #define SW_BORDER_MODE_FRAME    0x04
-//#define SW_BORDER_MODE_PAGE     0x08
-//#define SW_BORDER_MODE_CHAR     0x10
 
 // flags for SvxBackgroundTabPage
 #define SVX_SHOW_SELECTOR       0x01
commit e28358e75aeb40cd51186cdcfe82b3880e7f6701
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Jul 25 10:24:57 2013 +0200

    Missing magic in font
    
    Change-Id: Ic3f4d12729c0309e03992c06f8a57da3d004c24a

diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 783524a..7a62c47 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -84,6 +84,7 @@ void SwFont::SetTopBorder( const editeng::SvxBorderLine* pTopBorder )
     else
         m_aTopBorder = boost::none;
     bFntChg = sal_True;
+    aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
 }
 
 void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder )
@@ -93,6 +94,7 @@ void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder )
     else
         m_aBottomBorder = boost::none;
     bFntChg = sal_True;
+    aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
 }
 
 void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder )
@@ -102,6 +104,7 @@ void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder )
     else
         m_aRightBorder = boost::none;
     bFntChg = sal_True;
+    aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
 }
 
 void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder )
@@ -111,6 +114,7 @@ void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder )
     else
         m_aLeftBorder = boost::none;
     bFntChg = sal_True;
+    aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
 }
 
 // maps directions for vertical layout
commit f8a4c68588e3cd209fd6bba8671d8f42f1cc1ce9
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Mon Jul 22 22:21:54 2013 +0200

    CharBrd 3: painting of border for simple text
    
    -Use the frame painting for character border
    -Increase the size of the portion
    (height, ascent and size)
    -Shift the text drawing rectangle
    -Make the text cursor to skip the borders
    
    Change-Id: Ia40fed5d7a93f85b73b7fa019ec4ede9421d89d1

diff --git a/sw/source/core/inc/frmtool.hxx b/sw/source/core/inc/frmtool.hxx
index 45b63bf..bd2e495 100644
--- a/sw/source/core/inc/frmtool.hxx
+++ b/sw/source/core/inc/frmtool.hxx
@@ -26,6 +26,7 @@
 #include "swcache.hxx"
 // #i96772#
 #include <editeng/lrspitem.hxx>
+#include <swfont.hxx>
 
 class SwPageFrm;
 class SwFlyFrm;
@@ -64,6 +65,9 @@ void SwAlignRect( SwRect &rRect, const ViewShell *pSh );
 // Created declaration here to avoid <extern> declarations
 void SwAlignGrfRect( SwRect *pGrfRect, const OutputDevice &rOut );
 
+// Paint character border using frame painting code
+void PaintCharacterBorder( const SwFont& rFont, const SwRect& rPaintArea);
+
 // get Fly, if no List is given use the current shell
 // Implementation in feshview.cxx
 SwFlyFrm *GetFlyFromMarked( const SdrMarkList *pLst, ViewShell *pSh );
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index 6d99fd3..ca3fcd7 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4561,13 +4561,11 @@ static void
 lcl_MakeBorderLine(SwRect const& rRect,
         bool const isVerticalInModel,
         bool const isLeftOrTopBorderInModel,
+        bool const isVertical,
         SvxBorderLine const& rBorder,
         SvxBorderLine const*const pLeftOrTopNeighbour,
         SvxBorderLine const*const pRightOrBottomNeighbour)
 {
-    // fdo#44010: for vertical text lcl_PaintTopBottomLine produces vertical
-    // borders and lcl_PaintLeftRightLine horizontal ones.
-    bool const isVertical(rRect.Height() > rRect.Width());
     bool const isLeftOrTopBorder((isVerticalInModel == isVertical)
             ? isLeftOrTopBorderInModel
             : (isLeftOrTopBorderInModel != isVertical));
@@ -4713,7 +4711,8 @@ static void lcl_PaintLeftRightLine( const bool         _bLeft,
     if ( lcl_GetLineWidth( pLeftRightBorder ) > 0 )
     {
         lcl_MakeBorderLine(
-            aRect, true, _bLeft, *pLeftRightBorder, pTopBorder, pBottomBorder);
+            aRect, true, _bLeft, aRect.Height() > aRect.Width(),
+            *pLeftRightBorder, pTopBorder, pBottomBorder);
     }
 }
 
@@ -4759,7 +4758,84 @@ static void lcl_PaintTopBottomLine( const bool         _bTop,
     if ( lcl_GetLineWidth( pTopBottomBorder ) > 0 )
     {
         lcl_MakeBorderLine(
-            aRect, false, _bTop, *pTopBottomBorder, rBox.GetLeft(), rBox.GetRight());
+            aRect, false, _bTop, aRect.Height() > aRect.Width(),
+            *pTopBottomBorder, rBox.GetLeft(), rBox.GetRight());
+    }
+}
+
+void PaintCharacterBorder(
+    const SwFont& rFont,
+    const SwRect& rPaintArea )
+{
+    SwRect aAlignedRect(rPaintArea);
+    SwAlignRect(aAlignedRect, pGlobalShell);
+
+    if( rFont.GetTopBorder() )
+    {
+        Point aLeftTop (
+            aAlignedRect.Left(),
+            aAlignedRect.Top());
+        Point aRightBottom (
+            aAlignedRect.Right(),
+            aAlignedRect.Top() + rFont.GetTopBorder().get().GetScaledWidth());
+
+        lcl_MakeBorderLine(
+            SwRect( aLeftTop, aRightBottom),
+            false, true, false,
+            rFont.GetTopBorder().get(),
+            rFont.GetLeftBorder().get_ptr(),
+            rFont.GetRightBorder().get_ptr());
+    }
+
+    if( rFont.GetBottomBorder() )
+    {
+        Point aLeftTop (
+            aAlignedRect.Left(),
+            aAlignedRect.Bottom() - rFont.GetBottomBorder().get().GetScaledWidth());
+        Point aRightBottom (
+            aAlignedRect.Right(),
+            aAlignedRect.Bottom());
+
+        lcl_MakeBorderLine(
+            SwRect( aLeftTop, aRightBottom),
+            false, false, false,
+            rFont.GetBottomBorder().get(),
+            rFont.GetLeftBorder().get_ptr(),
+            rFont.GetRightBorder().get_ptr());
+    }
+
+    if( rFont.GetLeftBorder() )
+    {
+        Point aLeftTop (
+            aAlignedRect.Left(),
+            aAlignedRect.Top());
+        Point aRightBottom (
+            aAlignedRect.Left() + rFont.GetLeftBorder().get().GetScaledWidth(),
+            aAlignedRect.Bottom());
+
+        lcl_MakeBorderLine(
+            SwRect( aLeftTop, aRightBottom),
+            true, true, true,
+            rFont.GetLeftBorder().get(),
+            rFont.GetTopBorder().get_ptr(),
+            rFont.GetBottomBorder().get_ptr());
+    }
+
+    if( rFont.GetRightBorder() )
+    {
+        Point aLeftTop (
+            aAlignedRect.Right() - rFont.GetRightBorder().get().GetScaledWidth(),
+            aAlignedRect.Top());
+        Point aRightBottom (
+            aAlignedRect.Right(),
+            aAlignedRect.Bottom());
+
+        lcl_MakeBorderLine(
+            SwRect( aLeftTop, aRightBottom),
+            true, false, true,
+            rFont.GetRightBorder().get(),
+            rFont.GetTopBorder().get_ptr(),
+            rFont.GetBottomBorder().get_ptr());
     }
 }
 
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 03628da..37baa9e 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -112,6 +112,12 @@ 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()->GetRightBorder().get().GetScaledWidth();
+    if( rInf.GetFont()->GetLeftBorder() )
+        nLineWidth -= rInf.GetFont()->GetLeftBorder().get().GetScaledWidth();
+
     const bool bUnbreakableNumberings = rInf.GetTxtFrm()->GetTxtNode()->
             getIDocumentSettingAccess()->get(IDocumentSettingAccess::UNBREAKABLE_NUMBERINGS);
 
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index b2fc17b..39efe1f 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -67,6 +67,7 @@
 // #i12836# enhanced pdf export
 #include <EnhancedPDFExportHelper.hxx>
 #include <docufld.hxx>
+#include <frmtool.hxx>
 
 #include <unomid.h>
 
@@ -366,6 +367,52 @@ void SwTxtSizeInfo::NoteAnimation() const
             "SwTxtSizeInfo::NoteAnimation() changed m_pOut" );
 }
 
+
+KSHORT SwTxtSizeInfo::GetAscent() const
+{
+    SAL_WARN_IF( !GetOut(), "sw.text.txtinfo", "SwTxtSizeInfo::GetAscent() without m_pOut" );
+
+    sal_uInt16 nAscent = ((SwFont*)GetFont())->GetAscent( m_pVsh, *GetOut() );
+
+    if( GetFont()->GetTopBorder() )
+        nAscent += GetFont()->GetTopBorder().get().GetScaledWidth();
+
+    return nAscent;
+}
+
+KSHORT SwTxtSizeInfo::GetTxtHeight() const
+{
+    SAL_WARN_IF( !GetOut(), "sw.text.txtinfo", "SwTxtSizeInfo::GetTxtHeight() without m_pOut" );
+
+    sal_uInt16 nHeight = ((SwFont*)GetFont())->GetHeight( m_pVsh, *GetOut() );
+
+    if( GetFont()->GetTopBorder() )
+        nHeight += GetFont()->GetTopBorder().get().GetScaledWidth();
+    if( GetFont()->GetBottomBorder() )
+        nHeight += GetFont()->GetBottomBorder().get().GetScaledWidth();
+
+    return nHeight;
+}
+
+static void lcl_IncreaseSizeWithBorders(SwPosSize& rSize, const SwFont& rFont)
+{
+
+    sal_uInt16 nWidth = rSize.Width();
+    sal_uInt16 nHeight = rSize.Height();
+
+    if( rFont.GetTopBorder() )
+        nHeight += rFont.GetTopBorder().get().GetScaledWidth();
+    if( rFont.GetBottomBorder() )
+        nHeight += rFont.GetBottomBorder().get().GetScaledWidth();
+    if( rFont.GetRightBorder() )
+        nWidth += rFont.GetRightBorder().get().GetScaledWidth();
+    if( rFont.GetLeftBorder() )
+        nWidth += rFont.GetLeftBorder().get().GetScaledWidth();
+
+    rSize.Height(nHeight);
+    rSize.Width(nWidth);
+}
+
 SwPosSize SwTxtSizeInfo::GetTxtSize( OutputDevice* pOutDev,
                                      const SwScriptInfo* pSI,
                                      const XubString& rTxt,
@@ -379,6 +426,7 @@ SwPosSize SwTxtSizeInfo::GetTxtSize( OutputDevice* pOutDev,
     aDrawInf.SetSnapToGrid( SnapToGrid() );
     aDrawInf.SetKanaComp( nComp );
     SwPosSize aSize = m_pFnt->_GetTxtSize( aDrawInf );
+    lcl_IncreaseSizeWithBorders(aSize,*m_pFnt);
     return aSize;
 }
 
@@ -400,7 +448,9 @@ SwPosSize SwTxtSizeInfo::GetTxtSize() const
     aDrawInf.SetFont( m_pFnt );
     aDrawInf.SetSnapToGrid( SnapToGrid() );
     aDrawInf.SetKanaComp( nComp );
-    return m_pFnt->_GetTxtSize( aDrawInf );
+    SwPosSize aSize = m_pFnt->_GetTxtSize( aDrawInf );
+    lcl_IncreaseSizeWithBorders(aSize,*m_pFnt);
+    return aSize;
 }
 
 void SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIndex,
@@ -413,6 +463,7 @@ void SwTxtSizeInfo::GetTxtSize( const SwScriptInfo* pSI, const xub_StrLen nIndex
     aDrawInf.SetSnapToGrid( SnapToGrid() );
     aDrawInf.SetKanaComp( nComp );
     SwPosSize aSize = m_pFnt->_GetTxtSize( aDrawInf );
+    lcl_IncreaseSizeWithBorders(aSize,*m_pFnt);
     nMaxSizeDiff = (sal_uInt16)aDrawInf.GetKanaDiff();
     nMinSize = aSize.Width();
 }
@@ -610,8 +661,16 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
     SwDrawTextInfo aDrawInf( m_pFrm->getRootFrm()->GetCurrShell(), *m_pOut, pSI, rText, nStart, nLength,
                              rPor.Width(), bBullet );
 
-    aDrawInf.SetLeft( GetPaintRect().Left() );
-    aDrawInf.SetRight( GetPaintRect().Right() );
+    if( m_pFnt->GetLeftBorder() )
+        aDrawInf.SetLeft( GetPaintRect().Left() + m_pFnt->GetLeftBorder().get().GetScaledWidth() );
+    else
+        aDrawInf.SetLeft( GetPaintRect().Left() );
+
+    if( m_pFnt->GetRightBorder() )
+        aDrawInf.SetRight( GetPaintRect().Right() - m_pFnt->GetRightBorder().get().GetScaledWidth() );
+    else
+        aDrawInf.SetRight( GetPaintRect().Right());
+
     aDrawInf.SetUnderFnt( m_pUnderFnt );
 
     const long nSpaceAdd = ( rPor.IsBlankPortion() || rPor.IsDropPortion() ||
@@ -641,11 +700,16 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
                              rPor.GetPortion()->InFixMargGrp() ||
                              rPor.GetPortion()->IsHolePortion() );
 
+    // Draw text next to the left border
+    Point aFontPos(aPos);
+    if( m_pFnt->GetLeftBorder() )
+       aFontPos.X() += m_pFnt->GetLeftBorder().get().GetScaledWidth();
+
     if( GetTxtFly()->IsOn() )
     {
         // aPos needs to be the TopLeft, because we cannot calculate the
         // ClipRects otherwise
-        const Point aPoint( aPos.X(), aPos.Y() - rPor.GetAscent() );
+        const Point aPoint( aFontPos.X(), aFontPos.Y() - rPor.GetAscent() );
         const Size aSize( rPor.Width(), rPor.Height() );
         aDrawInf.SetPos( aPoint );
         aDrawInf.SetSize( aSize );
@@ -658,7 +722,7 @@ void SwTxtPaintInfo::_DrawText( const XubString &rText, const SwLinePortion &rPo
     }
     else
     {
-        aDrawInf.SetPos( aPos );
+        aDrawInf.SetPos( aFontPos );
         if( bKern )
             m_pFnt->_DrawStretchText( aDrawInf );
         else
@@ -1153,6 +1217,16 @@ void SwTxtPaintInfo::_DrawBackBrush( const SwLinePortion &rPor ) const
     }
 }
 
+void SwTxtPaintInfo::DrawBorder( const SwLinePortion &rPor ) const
+{
+    SwRect aDrawArea;
+    CalcRect( rPor, &aDrawArea );
+    if ( aDrawArea.HasArea() )
+    {
+        PaintCharacterBorder(*m_pFnt, aDrawArea);
+    }
+}
+
 void SwTxtPaintInfo::DrawViewOpt( const SwLinePortion &rPor,
                                   const MSHORT nWhich ) const
 {
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 38efa9a..c9d5d10 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -267,7 +267,7 @@ public:
     inline sal_Unicode GetChar( const sal_Int32 nPos ) const
     { if (m_pTxt && !m_pTxt->isEmpty()) return (*m_pTxt)[ nPos ]; return 0; }
 
-    inline KSHORT      GetTxtHeight() const;
+    KSHORT      GetTxtHeight() const;
 
     //
     // GetTxtSize
@@ -294,7 +294,7 @@ public:
                                            const sal_uInt16 nComp,
                                            xub_StrLen& rExtraCharPos ) const;
 
-    inline KSHORT GetAscent() const;
+    KSHORT GetAscent() const;
 
     inline sal_Int32 GetIdx() const { return m_nIdx; }
     inline void SetIdx( const sal_Int32 nNew ) { m_nIdx = nNew; }
@@ -442,6 +442,8 @@ public:
     inline void DrawBackBrush( const SwLinePortion &rPor ) const
     { /* if( pFnt->GetBackColor() ) */ _DrawBackBrush( rPor ); }
 
+    void DrawBorder( const SwLinePortion &rPor ) const;
+
     void DrawCheckBox( const SwFieldFormPortion &rPor, bool checked) const;
 
     inline void NotifyURL( const SwLinePortion &rPor ) const
@@ -778,19 +780,6 @@ public:
 /*************************************************************************
  * Inline implementations of SwTxtSizeInfo
  *************************************************************************/
-
-inline KSHORT SwTxtSizeInfo::GetAscent() const
-{
-    OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetAscent() without m_pOut" );
-    return ((SwFont*)GetFont())->GetAscent( m_pVsh, *GetOut() );
-}
-
-inline KSHORT SwTxtSizeInfo::GetTxtHeight() const
-{
-    OSL_ENSURE( GetOut(), "SwTxtSizeInfo::GetTxtHeight() without m_pOut" );
-    return ((SwFont*)GetFont())->GetHeight( m_pVsh, *GetOut() );
-}
-
 inline SwPosSize SwTxtSizeInfo::GetTxtSize( const XubString &rTxt ) const
 {
     return GetTxtSize( m_pOut, 0, rTxt, 0, rTxt.Len(), 0 );
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 42ab844..17b7681 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -922,6 +922,12 @@ void SwTxtCursor::_GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
                             }
                         }
                         pPor->SetLen( nOldLen );
+
+                        // Shift the cursor with the right border width
+                        // Note: nX remains positive because GetTxtSize() also include the width of the right border
+                        if( GetInfo().GetFont()->GetRightBorder() && aInf.GetIdx() < nOfst && nOfst < aInf.GetIdx() + pPor->GetLen() )
+                                nX -= GetInfo().GetFont()->GetRightBorder().get().GetScaledWidth();
+
                     }
                     bWidth = sal_False;
                     break;
@@ -1245,6 +1251,7 @@ sal_Bool SwTxtCursor::GetCharRect( SwRect* pOrig, const xub_StrLen nOfst,
         if( nOut > 0 )
             pOrig->Pos().X() -= nOut + 10;
     }
+
     return bRet;
 }
 
@@ -1609,6 +1616,11 @@ xub_StrLen SwTxtCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
                                          aSizeInf.GetTxt(),
                                          aSizeInf.GetIdx(),
                                          pPor->GetLen() );
+
+                // Shift the offset with the left border width
+                if( GetInfo().GetFont()->GetLeftBorder() )
+                    nX = std::max(0, nX - GetInfo().GetFont()->GetLeftBorder().get().GetScaledWidth());
+
                 aDrawInf.SetOfst( nX );
 
                 if ( nSpaceAdd )
diff --git a/sw/source/core/text/portxt.cxx b/sw/source/core/text/portxt.cxx
index e65e9a6..254f93f 100644
--- a/sw/source/core/text/portxt.cxx
+++ b/sw/source/core/text/portxt.cxx
@@ -559,6 +559,7 @@ void SwTxtPortion::Paint( const SwTxtPaintInfo &rInf ) const
     else if( GetLen() )
     {
         rInf.DrawBackBrush( *this );
+        rInf.DrawBorder( *this );
 
         // do we have to repaint a post it portion?
         if( rInf.OnWin() && pPortion && !pPortion->Width() )
commit 318bbbfc9bad8c0e04306faade2dec956ff89d28
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Jul 17 19:09:34 2013 +0200

    Use SwTxtInfo height and ascent for portions
    
    By now this is the same as the font's ascent and height
    but it can change.
    
    Change-Id: Ia40fed5d7a93f85b73b7fa019ec4ede9421d89d1

diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 56dcbef..fcd49c1 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -758,10 +758,8 @@ void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
     {
         // Numbering + InterNetFlds can keep an own font, then their size is
         // independent from hard attribute values
-        SwFont* pFldFnt = ((SwFldPortion*)pPor)->pFnt;
-        SwFontSave aSave( rInf, pFldFnt );
-        ((SwFldPortion*)pPor)->Height( pFldFnt->GetHeight( rInf.GetVsh(), *rInf.GetOut() ) );
-        ((SwFldPortion*)pPor)->SetAscent( pFldFnt->GetAscent( rInf.GetVsh(), *rInf.GetOut() ) );
+        pPor->Height( rInf.GetTxtHeight() );
+        pPor->SetAscent( rInf.GetAscent() );
     }
     // #i89179#
     // tab portion representing the list tab of a list label gets the
@@ -810,7 +808,7 @@ void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
                 bChg = SeekAndChg( rInf );
         }
         if( bChg || bFirstPor || !pPor->GetAscent()
-            || !rInf.GetLast()->InTxtGrp() )
+            || !pLast->InTxtGrp() )
         {
             pPor->SetAscent( rInf.GetAscent()  );
             pPor->Height( rInf.GetTxtHeight() );
commit e992bd5090226fc4ee43606e0fe37fbbee0ca401
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Jul 11 10:15:44 2013 +0200

    Make some changes in SwFont's borders
    
    Change-Id: I901094a45f339b0702481a3fd60f3b7effc96143

diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index a9c5a98..c2dc2d1 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -182,10 +182,10 @@ public:
     void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
     void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
 
-    const boost::optional<editeng::SvxBorderLine>& GetTopBorder() { return m_aTopBorder; }
-    const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() { return m_aBottomBorder; }
-    const boost::optional<editeng::SvxBorderLine>& GetRightBorder() { return m_aRightBorder; }
-    const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() { return m_aLeftBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; }
 
     inline void ChkMagic( ViewShell *pSh, sal_uInt8 nWhich )
         { if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index a45aa61..783524a 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -452,10 +452,6 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
 
 SwFont::SwFont()
     : pBackColor(0)
-    , m_aTopBorder(boost::none)
-    , m_aBottomBorder(boost::none)
-    , m_aRightBorder(boost::none)
-    , m_aLeftBorder(boost::none)
     , nActual(SW_LATIN)
 {
 }
commit 45519ecc1adb4ca975cac97842c0959677ebc2b1
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Mon Jul 8 17:16:13 2013 +0200

    Use optional member data for borders in SwFont
    
    Change-Id: Ib7e51aea8253128178e534eb8281975959e59810

diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index e09a08a..a9c5a98 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -27,6 +27,7 @@
 #include <swtypes.hxx>
 #include <drawfont.hxx>     // SwDrawTextInfo
 #include <editeng/borderline.hxx> // SvxBorderLine
+#include <boost/optional.hpp>
 
 class SfxItemSet;
 class SwAttrSet;
@@ -130,10 +131,10 @@ class SwFont
     Color       aOverColor;     // color of the overlining
 
     // character borders
-    editeng::SvxBorderLine*     m_pTopBorder;
-    editeng::SvxBorderLine*     m_pBottomBorder;
-    editeng::SvxBorderLine*     m_pRightBorder;
-    editeng::SvxBorderLine*     m_pLeftBorder;
+    boost::optional<editeng::SvxBorderLine>     m_aTopBorder;
+    boost::optional<editeng::SvxBorderLine>     m_aBottomBorder;
+    boost::optional<editeng::SvxBorderLine>     m_aRightBorder;
+    boost::optional<editeng::SvxBorderLine>     m_aLeftBorder;
 
     sal_uInt8       nToxCnt;        // Zaehlt die Schachtelungstiefe der Tox
     sal_uInt8       nRefCnt;        // Zaehlt die Schachtelungstiefe der Refs
@@ -181,10 +182,10 @@ public:
     void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
     void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
 
-    const editeng::SvxBorderLine* GetTopBorder() { return m_pTopBorder; }
-    const editeng::SvxBorderLine* GetBottomBorder() { return m_pBottomBorder; }
-    const editeng::SvxBorderLine* GetRightBorder() { return m_pRightBorder; }
-    const editeng::SvxBorderLine* GetLeftBorder() { return m_pLeftBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetTopBorder() { return m_aTopBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() { return m_aBottomBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetRightBorder() { return m_aRightBorder; }
+    const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() { return m_aLeftBorder; }
 
     inline void ChkMagic( ViewShell *pSh, sal_uInt8 nWhich )
         { if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 5d40a10..a45aa61 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -79,41 +79,37 @@ void SwFont::SetBackColor( Color* pNewColor )
 
 void SwFont::SetTopBorder( const editeng::SvxBorderLine* pTopBorder )
 {
-    delete m_pTopBorder;
     if( pTopBorder )
-        m_pTopBorder = new editeng::SvxBorderLine(*pTopBorder);
+        m_aTopBorder = *pTopBorder;
     else
-        m_pTopBorder = 0;
+        m_aTopBorder = boost::none;
     bFntChg = sal_True;
 }
 
 void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder )
 {
-    delete m_pBottomBorder;
     if( pBottomBorder )
-        m_pBottomBorder = new editeng::SvxBorderLine(*pBottomBorder);
+        m_aBottomBorder = *pBottomBorder;
     else
-        m_pBottomBorder = 0;
+        m_aBottomBorder = boost::none;
     bFntChg = sal_True;
 }
 
 void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder )
 {
-    delete m_pRightBorder;
     if( pRightBorder )
-        m_pRightBorder = new editeng::SvxBorderLine(*pRightBorder);
+        m_aRightBorder = *pRightBorder;
     else
-        m_pRightBorder = 0;
+        m_aRightBorder = boost::none;
     bFntChg = sal_True;
 }
 
 void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder )
 {
-    delete m_pLeftBorder;
     if( pLeftBorder )
-        m_pLeftBorder = new editeng::SvxBorderLine(*pLeftBorder);
+        m_aLeftBorder = *pLeftBorder;
     else
-        m_pLeftBorder = 0;
+        m_aLeftBorder = boost::none;
     bFntChg = sal_True;
 }
 
@@ -245,11 +241,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
     delete pBackColor;
     pBackColor = NULL;
 
-    delete m_pTopBorder;
-    delete m_pBottomBorder;
-    delete m_pRightBorder;
-    delete m_pLeftBorder;
-    m_pTopBorder = m_pBottomBorder = m_pRightBorder = m_pLeftBorder = 0;
+    m_aTopBorder = m_aBottomBorder = m_aRightBorder = m_aLeftBorder = boost::none;
 
     if( pAttrSet )
     {
@@ -432,10 +424,10 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
         if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BOX,
             sal_True, &pItem ))
         {
-            m_pTopBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetTop() );
-            m_pBottomBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetBottom() );
-            m_pRightBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetRight() );
-            m_pLeftBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetLeft() );
+            m_aTopBorder = *((SvxBoxItem*)pItem)->GetTop();
+            m_aBottomBorder = *((SvxBoxItem*)pItem)->GetBottom();
+            m_aRightBorder = *((SvxBoxItem*)pItem)->GetRight();
+            m_aLeftBorder = *((SvxBoxItem*)pItem)->GetLeft();
         }
         const SfxPoolItem* pTwoLinesItem = 0;
         if( SFX_ITEM_SET ==
@@ -460,10 +452,10 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
 
 SwFont::SwFont()
     : pBackColor(0)
-    , m_pTopBorder(0)
-    , m_pBottomBorder(0)
-    , m_pRightBorder(0)
-    , m_pLeftBorder(0)
+    , m_aTopBorder(boost::none)
+    , m_aBottomBorder(boost::none)
+    , m_aRightBorder(boost::none)
+    , m_aLeftBorder(boost::none)
     , nActual(SW_LATIN)
 {
 }
@@ -475,10 +467,10 @@ SwFont::SwFont( const SwFont &rFont )
     aSub[SW_CTL] = rFont.aSub[SW_CTL];
     nActual = rFont.nActual;
     pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL;
-    m_pTopBorder = rFont.m_pTopBorder ? new editeng::SvxBorderLine( *rFont.m_pTopBorder ) : 0;
-    m_pBottomBorder = rFont.m_pBottomBorder ? new editeng::SvxBorderLine( *rFont.m_pBottomBorder ) : 0;
-    m_pRightBorder = rFont.m_pRightBorder ? new editeng::SvxBorderLine( *rFont.m_pRightBorder ) : 0;
-    m_pLeftBorder = rFont.m_pLeftBorder ? new editeng::SvxBorderLine( *rFont.m_pLeftBorder ) : 0;
+    m_aTopBorder = rFont.m_aTopBorder;
+    m_aBottomBorder = rFont.m_aBottomBorder;
+    m_aRightBorder = rFont.m_aRightBorder;
+    m_aLeftBorder = rFont.m_aLeftBorder;
     aUnderColor = rFont.GetUnderColor();
     aOverColor  = rFont.GetOverColor();
     nToxCnt = 0;
@@ -605,13 +597,13 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
     if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BOX,
         sal_True, &pItem ))
     {
-        m_pTopBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetTop() );
-        m_pBottomBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetBottom() );
-        m_pRightBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetRight() );
-        m_pLeftBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetLeft() );
+        m_aTopBorder = *((SvxBoxItem*)pItem)->GetTop();
+        m_aBottomBorder = *((SvxBoxItem*)pItem)->GetBottom();
+        m_aRightBorder = *((SvxBoxItem*)pItem)->GetRight();
+        m_aLeftBorder = *((SvxBoxItem*)pItem)->GetLeft();
     }
     else
-        m_pTopBorder = m_pBottomBorder = m_pRightBorder = m_pLeftBorder = 0;
+        m_aTopBorder = m_aBottomBorder = m_aRightBorder = m_aLeftBorder = boost::none;
 
     const SvxTwoLinesItem& rTwoLinesItem = pAttrSet->Get2Lines();
     if ( ! rTwoLinesItem.GetValue() )
@@ -629,10 +621,6 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
 SwFont::~SwFont()
 {
     delete pBackColor;
-    delete m_pTopBorder;
-    delete m_pBottomBorder;
-    delete m_pRightBorder;
-    delete m_pLeftBorder;
 }
 
 SwSubFont& SwSubFont::operator=( const SwSubFont &rFont )
@@ -656,14 +644,10 @@ SwFont& SwFont::operator=( const SwFont &rFont )
     nActual = rFont.nActual;
     delete pBackColor;
     pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL;
-    delete m_pTopBorder;
-    delete m_pBottomBorder;
-    delete m_pRightBorder;
-    delete m_pLeftBorder;
-    m_pTopBorder = rFont.m_pTopBorder ? new editeng::SvxBorderLine( *rFont.m_pTopBorder ) : 0;
-    m_pBottomBorder = rFont.m_pBottomBorder ? new editeng::SvxBorderLine( *rFont.m_pBottomBorder ) : 0;
-    m_pRightBorder = rFont.m_pRightBorder ? new editeng::SvxBorderLine( *rFont.m_pRightBorder ) : 0;
-    m_pLeftBorder = rFont.m_pLeftBorder ? new editeng::SvxBorderLine( *rFont.m_pLeftBorder ) : 0;
+    m_aTopBorder = rFont.m_aTopBorder;
+    m_aBottomBorder = rFont.m_aBottomBorder;
+    m_aRightBorder = rFont.m_aRightBorder;
+    m_aLeftBorder = rFont.m_aLeftBorder;
     aUnderColor = rFont.GetUnderColor();
     aOverColor  = rFont.GetOverColor();
     nToxCnt = 0;
commit 7b776bc01911e7b3ff0044bf88cfed9bcd1d97d8
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Sun Jul 7 20:33:40 2013 +0200

    CharBrd 2: new character attribute
    
    - Add new character attribute id
    - Update attribute set and attribute stack
    - Convert character set item to general item and back
    when execute "Borders" tab page.
    - Add new SwFont attributes for different borders
    (top, bottom, right, left) This will be used for
    painting.
    
    Change-Id: I344babc3645931537cfa37d64f1f6c6c02c1cee3

diff --git a/sw/inc/charatr.hxx b/sw/inc/charatr.hxx
index 886437a..5ac0b34 100644
--- a/sw/inc/charatr.hxx
+++ b/sw/inc/charatr.hxx
@@ -99,6 +99,8 @@ inline const SvxCharReliefItem  &SwAttrSet::GetCharRelief( sal_Bool bInP ) const
     {   return (const SvxCharReliefItem&)Get( RES_CHRATR_RELIEF, bInP ); }
 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 ); }
 
 // implementation of the character attribute methods of SwFmt
 
@@ -160,6 +162,8 @@ inline const SvxCharReliefItem     &SwFmt::GetCharRelief( sal_Bool bInP ) const
     {   return aSet.GetCharRelief(bInP); }
 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); }
 
 #endif
 
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index bf565f4..09dde27 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -209,6 +209,7 @@ public:
     inline const SvxCharRotateItem     &GetCharRotate( sal_Bool = sal_True ) const;
     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;
 
     /// 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 1cc5857..37d5a39 100644
--- a/sw/inc/hintids.hxx
+++ b/sw/inc/hintids.hxx
@@ -87,8 +87,8 @@ RES_CHRATR_BEGIN = HINT_BEGIN,
     RES_CHRATR_RELIEF,                      // 36
     RES_CHRATR_HIDDEN,                      // 37
     RES_CHRATR_OVERLINE,                    // 38
-    RES_CHRATR_RSID,						// 39
-    RES_CHRATR_DUMMY1,						// 40
+    RES_CHRATR_RSID,                        // 39
+    RES_CHRATR_BOX,                         // 40
 RES_CHRATR_END
 };
 
diff --git a/sw/inc/swatrset.hxx b/sw/inc/swatrset.hxx
index 51d7afd..492bd11 100644
--- a/sw/inc/swatrset.hxx
+++ b/sw/inc/swatrset.hxx
@@ -252,6 +252,7 @@ public:
     inline const SvxCharRotateItem        &GetCharRotate( sal_Bool = sal_True ) const;
     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;
 
     // Frame attributes. Implementation in frmatr.hxx.
     inline const SwFmtFillOrder       &GetFillOrder( sal_Bool = sal_True ) const;
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 7d585b7..103c73e 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -288,7 +288,7 @@ SfxItemInfo aSlotTab[] =
     { SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE },        // RES_CHRATR_HIDDEN
     { SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE },      // RES_CHRATR_OVERLINE
     { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_RSID
-    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_DUMMY1
+    { 0, SFX_ITEM_POOLABLE },                           // RES_CHRATR_BOX
 
     { 0, 0 },                                           // RES_TXTATR_REFMARK
     { 0, 0 },                                           // RES_TXTATR_TOXMARK
@@ -497,9 +497,7 @@ void _InitCore()
     aAttrTab[ RES_CHRATR_RELIEF - POOLATTR_BEGIN ] =        new SvxCharReliefItem( RELIEF_NONE, RES_CHRATR_RELIEF );
     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 );
-
-// CharakterAttr - Dummies
-    aAttrTab[ RES_CHRATR_DUMMY1 - POOLATTR_BEGIN ] =        new SfxBoolItem( RES_CHRATR_DUMMY1 );
+    aAttrTab[ RES_CHRATR_BOX - POOLATTR_BEGIN ] =           new SvxBoxItem( RES_CHRATR_BOX );
 
     aAttrTab[ RES_TXTATR_AUTOFMT- POOLATTR_BEGIN ] =        new SwFmtAutoFmt;
     aAttrTab[ RES_TXTATR_INETFMT - POOLATTR_BEGIN ] =       new SwFmtINetFmt( aEmptyStr, aEmptyStr );
@@ -695,7 +693,10 @@ void _InitCore()
         SwAttrPool::pVersionMap5[ i-1 ] = i + 6;
 
     // 6. version:
+    //      RES_CHARATR_OVERLINE
     //      new character attribute for overlining plus 2 dummies
+    //      1. dummy -> RES_CHRATR_RSID
+    //      2. dummy -> RES_CHRATR_BOX
     SwAttrPool::pVersionMap6 = new sal_uInt16[ 136 ];
     for( i = 1; i <= 37; i++ )
         SwAttrPool::pVersionMap6[ i-1 ] = i;
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index efd10b7..4dd024a 100644
--- a/sw/source/core/doc/dbgoutsw.cxx
+++ b/sw/source/core/doc/dbgoutsw.cxx
@@ -160,6 +160,7 @@ map<sal_uInt16,String,CompareUShort> & GetItemWhichMap()
         aItemWhichMap[RES_CHRATR_SCALEW] = String("CHRATR_SCALEW", RTL_TEXTENCODING_ASCII_US);
         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_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 e908c84..d790581 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 36
+#define NUM_DEFAULT_VALUES 37
 
 #include "swcache.hxx"
 #include "swfont.hxx"
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index a023dc2..e09a08a 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -26,6 +26,7 @@
 #include <editeng/svxfont.hxx>
 #include <swtypes.hxx>
 #include <drawfont.hxx>     // SwDrawTextInfo
+#include <editeng/borderline.hxx> // SvxBorderLine
 
 class SfxItemSet;
 class SwAttrSet;
@@ -127,6 +128,13 @@ class SwFont
     Color*      pBackColor;     // background color (i.e. at character styles)
     Color       aUnderColor;    // color of the underlining
     Color       aOverColor;     // color of the overlining
+
+    // character borders
+    editeng::SvxBorderLine*     m_pTopBorder;
+    editeng::SvxBorderLine*     m_pBottomBorder;
+    editeng::SvxBorderLine*     m_pRightBorder;
+    editeng::SvxBorderLine*     m_pLeftBorder;
+
     sal_uInt8       nToxCnt;        // Zaehlt die Schachtelungstiefe der Tox
     sal_uInt8       nRefCnt;        // Zaehlt die Schachtelungstiefe der Refs
     sal_uInt8        m_nMetaCount;   // count META/METAFIELD
@@ -144,7 +152,7 @@ class SwFont
     sal_Bool bNoColReplace  :1;  // Replacement without colormanipulation
 
 protected:
-    inline SwFont() { pBackColor = NULL; nActual = SW_LATIN; }
+    SwFont();
 
 public:
     SwFont( const SwAttrSet* pSet, const IDocumentSettingAccess* pIDocumentSettingAccess );
@@ -153,7 +161,7 @@ public:
     inline void ChgFnt( ViewShell *pSh, OutputDevice& rOut )
         { bPaintBlank = aSub[nActual].ChgFnt( pSh, rOut ); }
 
-    ~SwFont(){ delete pBackColor; }
+    ~SwFont();
 
     SwFont& operator=( const SwFont &rFont );
 
@@ -167,6 +175,17 @@ public:
     void SetBackColor( Color* pNewColor );
     inline const Color* GetBackColor() const{ return pBackColor; }
 
+    // set/get borders
+    void SetTopBorder( const editeng::SvxBorderLine* pTopBorder );
+    void SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder );
+    void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
+    void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
+
+    const editeng::SvxBorderLine* GetTopBorder() { return m_pTopBorder; }
+    const editeng::SvxBorderLine* GetBottomBorder() { return m_pBottomBorder; }
+    const editeng::SvxBorderLine* GetRightBorder() { return m_pRightBorder; }
+    const editeng::SvxBorderLine* GetLeftBorder() { return m_pLeftBorder; }
+
     inline void ChkMagic( ViewShell *pSh, sal_uInt8 nWhich )
         { if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
     // uebernimmt die MagicNumber eines (hoffentlich ident.) Kollegen
diff --git a/sw/source/core/text/atrhndl.hxx b/sw/source/core/text/atrhndl.hxx
index a5a2782..24c5f91 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 40
+#define NUM_ATTRIBUTE_STACKS 41
 
 #include <txatbase.hxx>
 #include <swfntcch.hxx>
diff --git a/sw/source/core/text/atrstck.cxx b/sw/source/core/text/atrstck.cxx
index 2747f26..99fef3d 100644
--- a/sw/source/core/text/atrstck.cxx
+++ b/sw/source/core/text/atrstck.cxx
@@ -42,6 +42,7 @@
 #include <editeng/charscaleitem.hxx>
 #include <editeng/twolinesitem.hxx>
 #include <editeng/charhiddenitem.hxx>
+#include <editeng/boxitem.hxx>
 #include <viewopt.hxx>
 #include <charfmt.hxx>
 #include <fchrfmt.hxx>
@@ -62,7 +63,7 @@
  * stack, the top most attribute on the stack is valid. Because some
  * kinds of attributes have to be pushed to the same stacks we map their
  * ids to stack ids
- * Attention: The first NUM_DEFAULT_VALUES ( defined in swfntcch.hxx == 35 )
+ * Attention: The first NUM_DEFAULT_VALUES ( defined in swfntcch.hxx )
  * are stored in the defaultitem-cache, if you add one, you have to increase
  * NUM_DEFAULT_VALUES.
  * Also adjust NUM_ATTRIBUTE_STACKS in atrhndl.hxx.
@@ -111,15 +112,15 @@ const sal_uInt8 StackPos[ static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) -
     34, // RES_CHRATR_HIDDEN,                    // 37
     35, // RES_CHRATR_OVERLINE,                  // 38
      0, // RES_CHRATR_RSID,                      // 39
-     0, // RES_CHRATR_DUMMY1,                    // 40
-    36, // RES_TXTATR_REFMARK,                   // 41
-    37, // RES_TXTATR_TOXMARK,                   // 42
-    38, // RES_TXTATR_META,                      // 43
-    38, // RES_TXTATR_METAFIELD,                 // 44
+    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
-    39, // RES_TXTATR_CJK_RUBY,                  // 48
+    40, // RES_TXTATR_CJK_RUBY,                  // 48
      0, // RES_TXTATR_UNKNOWN_CONTAINER,         // 49
      0, // RES_TXTATR_DUMMY5                     // 50
 };
@@ -743,6 +744,12 @@ void SwAttrHandler::FontChg(const SfxPoolItem& rItem, SwFont& rFnt, sal_Bool bPu
             }
             break;
         }
+        case RES_CHRATR_BOX:
+            rFnt.SetTopBorder( ((SvxBoxItem&)rItem).GetTop() );
+            rFnt.SetBottomBorder( ((SvxBoxItem&)rItem).GetBottom() );
+            rFnt.SetRightBorder( ((SvxBoxItem&)rItem).GetRight() );
+            rFnt.SetLeftBorder( ((SvxBoxItem&)rItem).GetLeft() );
+            break;
         case RES_CHRATR_OVERLINE :
             rFnt.SetOverline( ((SvxOverlineItem&)rItem).GetLineStyle() );
             rFnt.SetOverColor( ((SvxOverlineItem&)rItem).GetColor() );
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index 977b6d2..5d40a10 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -48,6 +48,7 @@
 #include <editeng/charrotateitem.hxx>
 #include <editeng/twolinesitem.hxx>
 #include <editeng/charhiddenitem.hxx>
+#include <editeng/boxitem.hxx>
 #include <IDocumentSettingAccess.hxx>
 #include <vcl/window.hxx>
 #include <charatr.hxx>
@@ -76,6 +77,46 @@ void SwFont::SetBackColor( Color* pNewColor )
     aSub[SW_LATIN].pMagic = aSub[SW_CJK].pMagic = aSub[SW_CTL].pMagic = 0;
 }
 
+void SwFont::SetTopBorder( const editeng::SvxBorderLine* pTopBorder )
+{
+    delete m_pTopBorder;
+    if( pTopBorder )
+        m_pTopBorder = new editeng::SvxBorderLine(*pTopBorder);
+    else
+        m_pTopBorder = 0;
+    bFntChg = sal_True;
+}
+
+void SwFont::SetBottomBorder( const editeng::SvxBorderLine* pBottomBorder )
+{
+    delete m_pBottomBorder;
+    if( pBottomBorder )
+        m_pBottomBorder = new editeng::SvxBorderLine(*pBottomBorder);
+    else
+        m_pBottomBorder = 0;
+    bFntChg = sal_True;
+}
+
+void SwFont::SetRightBorder( const editeng::SvxBorderLine* pRightBorder )
+{
+    delete m_pRightBorder;
+    if( pRightBorder )
+        m_pRightBorder = new editeng::SvxBorderLine(*pRightBorder);
+    else
+        m_pRightBorder = 0;
+    bFntChg = sal_True;
+}
+
+void SwFont::SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder )
+{
+    delete m_pLeftBorder;
+    if( pLeftBorder )
+        m_pLeftBorder = new editeng::SvxBorderLine(*pLeftBorder);
+    else
+        m_pLeftBorder = 0;
+    bFntChg = sal_True;
+}
+
 // maps directions for vertical layout
 sal_uInt16 MapDirection( sal_uInt16 nDir, const sal_Bool bVertFormat )
 {
@@ -204,6 +245,12 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
     delete pBackColor;
     pBackColor = NULL;
 
+    delete m_pTopBorder;
+    delete m_pBottomBorder;
+    delete m_pRightBorder;
+    delete m_pLeftBorder;
+    m_pTopBorder = m_pBottomBorder = m_pRightBorder = m_pLeftBorder = 0;
+
     if( pAttrSet )
     {
         const SfxPoolItem* pItem;
@@ -382,8 +429,14 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
         if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BACKGROUND,
             sal_True, &pItem ))
             pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() );
-        else
-            pBackColor = NULL;
+        if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BOX,
+            sal_True, &pItem ))
+        {
+            m_pTopBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetTop() );
+            m_pBottomBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetBottom() );
+            m_pRightBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetRight() );
+            m_pLeftBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetLeft() );
+        }
         const SfxPoolItem* pTwoLinesItem = 0;
         if( SFX_ITEM_SET ==
                 pAttrSet->GetItemState( RES_CHRATR_TWO_LINES, sal_True, &pTwoLinesItem ))
@@ -405,6 +458,16 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
  *                      class SwFont
  *************************************************************************/
 
+SwFont::SwFont()
+    : pBackColor(0)
+    , m_pTopBorder(0)
+    , m_pBottomBorder(0)
+    , m_pRightBorder(0)
+    , m_pLeftBorder(0)
+    , nActual(SW_LATIN)
+{
+}
+
 SwFont::SwFont( const SwFont &rFont )
 {
     aSub[SW_LATIN] = rFont.aSub[SW_LATIN];
@@ -412,6 +475,10 @@ SwFont::SwFont( const SwFont &rFont )
     aSub[SW_CTL] = rFont.aSub[SW_CTL];
     nActual = rFont.nActual;
     pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL;
+    m_pTopBorder = rFont.m_pTopBorder ? new editeng::SvxBorderLine( *rFont.m_pTopBorder ) : 0;
+    m_pBottomBorder = rFont.m_pBottomBorder ? new editeng::SvxBorderLine( *rFont.m_pBottomBorder ) : 0;
+    m_pRightBorder = rFont.m_pRightBorder ? new editeng::SvxBorderLine( *rFont.m_pRightBorder ) : 0;
+    m_pLeftBorder = rFont.m_pLeftBorder ? new editeng::SvxBorderLine( *rFont.m_pLeftBorder ) : 0;
     aUnderColor = rFont.GetUnderColor();
     aOverColor  = rFont.GetOverColor();
     nToxCnt = 0;
@@ -534,6 +601,18 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
         pBackColor = new Color( ((SvxBrushItem*)pItem)->GetColor() );
     else
         pBackColor = NULL;
+
+    if( SFX_ITEM_SET == pAttrSet->GetItemState( RES_CHRATR_BOX,
+        sal_True, &pItem ))
+    {
+        m_pTopBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetTop() );
+        m_pBottomBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetBottom() );
+        m_pRightBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetRight() );
+        m_pLeftBorder = new editeng::SvxBorderLine(*((SvxBoxItem*)pItem)->GetLeft() );
+    }
+    else
+        m_pTopBorder = m_pBottomBorder = m_pRightBorder = m_pLeftBorder = 0;
+
     const SvxTwoLinesItem& rTwoLinesItem = pAttrSet->Get2Lines();
     if ( ! rTwoLinesItem.GetValue() )
         SetVertical( pAttrSet->GetCharRotate().GetValue() );
@@ -547,6 +626,15 @@ SwFont::SwFont( const SwAttrSet* pAttrSet,
     }
 }
 
+SwFont::~SwFont()
+{
+    delete pBackColor;
+    delete m_pTopBorder;
+    delete m_pBottomBorder;
+    delete m_pRightBorder;
+    delete m_pLeftBorder;
+}
+
 SwSubFont& SwSubFont::operator=( const SwSubFont &rFont )
 {
     SvxFont::operator=( rFont );
@@ -568,6 +656,14 @@ SwFont& SwFont::operator=( const SwFont &rFont )
     nActual = rFont.nActual;
     delete pBackColor;
     pBackColor = rFont.pBackColor ? new Color( *rFont.pBackColor ) : NULL;
+    delete m_pTopBorder;
+    delete m_pBottomBorder;
+    delete m_pRightBorder;
+    delete m_pLeftBorder;
+    m_pTopBorder = rFont.m_pTopBorder ? new editeng::SvxBorderLine( *rFont.m_pTopBorder ) : 0;
+    m_pBottomBorder = rFont.m_pBottomBorder ? new editeng::SvxBorderLine( *rFont.m_pBottomBorder ) : 0;
+    m_pRightBorder = rFont.m_pRightBorder ? new editeng::SvxBorderLine( *rFont.m_pRightBorder ) : 0;
+    m_pLeftBorder = rFont.m_pLeftBorder ? new editeng::SvxBorderLine( *rFont.m_pLeftBorder ) : 0;
     aUnderColor = rFont.GetUnderColor();
     aOverColor  = rFont.GetOverColor();
     nToxCnt = 0;
diff --git a/sw/source/filter/html/css1atr.cxx b/sw/source/filter/html/css1atr.cxx
index 32fc321..51fbc24 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3641,7 +3641,7 @@ SwAttrFnTab aCSS1AttrFnTab = {
 /* RES_CHRATR_HIDDEN */             OutCSS1_SvxHidden,
 /* RES_CHRATR_OVERLINE */           OutCSS1_SvxOverline,
 /* RES_CHRATR_RSID */               0,
-/* RES_CHRATR_DUMMY1 */             0,
+/* RES_CHRATR_BOX */                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 4e3548f..0879237 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -3232,7 +3232,7 @@ SwAttrFnTab aHTMLAttrFnTab = {
 /* RES_CHRATR_HIDDEN */             OutHTML_CSS1Attr,
 /* RES_CHRATR_OVERLINE */           OutHTML_CSS1Attr,
 /* RES_CHRATR_RSID */               0,
-/* RES_CHRATR_DUMMY1 */             0,
+/* RES_CHRATR_BOX */                0,
 
 /* RES_TXTATR_REFMARK */            0,
 /* RES_TXTATR_TOXMARK */            0,
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx
index 92c06c4..b5145bd 100644
--- a/sw/source/ui/app/docst.cxx
+++ b/sw/source/ui/app/docst.cxx
@@ -35,6 +35,7 @@
 #include <sfx2/printer.hxx>
 #include <svl/macitem.hxx>
 #include <editeng/brushitem.hxx>
+#include <editeng/boxitem.hxx>
 #include <svl/stritem.hxx>
 #include <svl/languageoptions.hxx>
 #include <editeng/eeitem.hxx>
@@ -577,6 +578,15 @@ IMPL_LINK_NOARG(ApplyStyle, ApplyHdl)
                 aTmpSet.Put( aTmpBrush );
             }
             aTmpSet.ClearItem( RES_BACKGROUND );
+
+            const SfxPoolItem *pTmpBox;
+            if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BOX, sal_False, &pTmpBox ) )
+            {
+                SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) );
+                aTmpBox.SetWhich( RES_CHRATR_BOX );
+                aTmpSet.Put( aTmpBox );
+            }
+            aTmpSet.ClearItem( RES_BOX );
         }
         m_xTmp->SetItemSet( aTmpSet );
 
@@ -743,6 +753,18 @@ sal_uInt16 SwDocShell::Edit(
             aTmpBrush.SetWhich( RES_BACKGROUND );
             rSet.Put( aTmpBrush );
         }
+        else
+            rSet.ClearItem(RES_BACKGROUND);
+
+        const SfxPoolItem *pTmpBox;
+        if( SFX_ITEM_SET == rSet.GetItemState( RES_CHRATR_BOX, sal_True, &pTmpBox ) )
+        {
+            SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) );
+            aTmpBox.SetWhich( RES_BOX );
+            rSet.Put( aTmpBox );
+        }
+        else
+            rSet.ClearItem(RES_BOX);
     }
     if (!bBasic)
     {
@@ -822,6 +844,15 @@ sal_uInt16 SwDocShell::Edit(
                     aTmpSet.Put( aTmpBrush );
                 }
                 aTmpSet.ClearItem( RES_BACKGROUND );
+
+                const SfxPoolItem *pTmpBox;
+                if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BOX, sal_False, &pTmpBox ) )
+                {
+                    SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) );
+                    aTmpBox.SetWhich( RES_CHRATR_BOX );
+                    aTmpSet.Put( aTmpBox );
+                }
+                aTmpSet.ClearItem( RES_BOX );
             }
             xTmp->SetItemSet( aTmpSet );
         }
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index 5def5e9..4dc1041 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -118,6 +118,7 @@ SwTemplateDlg::SwTemplateDlg(Window*            pParent,
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!");
             AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+
             SAL_WARN_IF(!pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "sw.fmtui", "GetTabPageCreatorFunc fail!");
             SAL_WARN_IF(!pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "sw.fmtui", "GetTabPageRangesFunc fail!");
             AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 65bf2a2..80fe613 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -46,6 +46,7 @@
 #include <editeng/colritem.hxx>
 #include <editeng/tstpitem.hxx>
 #include <editeng/brushitem.hxx>
+#include <editeng/boxitem.hxx>
 #include <editeng/svxacorr.hxx>
 #include <svl/cjkoptions.hxx>
 #include <svl/ctloptions.hxx>
@@ -139,6 +140,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
                         RES_CHRATR_BEGIN,      RES_CHRATR_END-1,
                         RES_TXTATR_INETFMT,    RES_TXTATR_INETFMT,
                         RES_BACKGROUND,        RES_BACKGROUND,
+                        RES_BOX,               RES_BOX,
                         SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
                         FN_PARAM_SELECTION,    FN_PARAM_SELECTION,
                         SID_HTML_MODE,         SID_HTML_MODE,
@@ -175,6 +177,20 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
         aTmpBrush.SetWhich( RES_BACKGROUND );
         aCoreSet.Put( aTmpBrush );
     }
+    else
+        aCoreSet.ClearItem(RES_BACKGROUND);
+
+    // The CHRATR_BOX attribute will be converted for the
+    // dialogue in a RES_BOX and back again ...
+    const SfxPoolItem *pTmpBox;
+    if( SFX_ITEM_SET == aCoreSet.GetItemState( RES_CHRATR_BOX, sal_True, &pTmpBox ) )
+    {
+        SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) );
+        aTmpBox.SetWhich( RES_BOX );
+        aCoreSet.Put( aTmpBox );
+    }
+    else
+        aCoreSet.ClearItem(RES_BOX);
 
     // Setting the BoxInfo
     ::PrepareBoxInfo( aCoreSet, rWrtSh );
@@ -213,9 +229,16 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
             aTmpBrush.SetWhich( RES_CHRATR_BACKGROUND );
             aTmpSet.Put( aTmpBrush );
         }
-
         aTmpSet.ClearItem( RES_BACKGROUND );
 
+        if( SFX_ITEM_SET == aTmpSet.GetItemState( RES_BOX, sal_False, &pTmpBox ) )
+        {
+            SvxBoxItem aTmpBox( *((SvxBoxItem*)pTmpBox) );
+            aTmpBox.SetWhich( RES_CHRATR_BOX );
+            aTmpSet.Put( aTmpBox );
+        }
+        aTmpSet.ClearItem( RES_BOX );
+
         const SfxPoolItem* pSelectionItem;
         sal_Bool bInsert = sal_False;
         xub_StrLen nInsert = 0;
commit 9bb7349bdbcb00ce73c50d37ffe55476939751c1
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Jun 26 18:18:25 2013 +0200

    CharBrd 1: Add Borders tab page
    
    - Differentiate character dialog types
      (border is available only for simple text)
    - Tab page must be added for two dialog(SwCharDlg and SwTemplateDlg)
    - SvxBoxInfoItem (SID_ATTR_BORDER_INNER) is initialized
      before execute dialog (used as input).
    
    Change-Id: I73723a018b6cf4cd292ba44b1bd7e1af3c6a6deb

diff --git a/include/svx/flagsdef.hxx b/include/svx/flagsdef.hxx
index 0b2ea7a..e6523dd 100644
--- a/include/svx/flagsdef.hxx
+++ b/include/svx/flagsdef.hxx
@@ -22,10 +22,12 @@
 // defines ---------------------------------------------------------------
 
 // copy from border.hxx
-// Border-Modes for paragraphs, textframes and tables
+// Border-Modes for SvxBorderTabPage
 #define SW_BORDER_MODE_PARA     0x01
 #define SW_BORDER_MODE_TABLE    0x02
 #define SW_BORDER_MODE_FRAME    0x04
+//#define SW_BORDER_MODE_PAGE     0x08
+//#define SW_BORDER_MODE_CHAR     0x10
 
 // flags for SvxBackgroundTabPage
 #define SVX_SHOW_SELECTOR       0x01
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index de82751..b2a73e3 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -340,7 +340,7 @@ public:
     virtual AbstractSwBreakDlg * CreateSwBreakDlg(Window *pParent, SwWrtShell &rSh) = 0; // add for SwBreakDlg
     virtual VclAbstractDialog   * CreateSwChangeDBDlg(SwView& rVw) = 0; //add for SwChangeDBDlg
     virtual SfxAbstractTabDialog *  CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
-        const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False) = 0;  // add for SwCharDlg
+        sal_uInt8 nDialogMode, const String* pFmtStr = 0) = 0;  // add for SwCharDlg
     virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable) = 0; //add for SwConvertTableDlg
     virtual VclAbstractDialog * CreateSwCaptionDialog ( Window *pParent, SwView &rV,int nResId) = 0; //add for SwCaptionDialog
 
diff --git a/sw/source/ui/app/docstyle.cxx b/sw/source/ui/app/docstyle.cxx
index 016e419..886e3cf 100644
--- a/sw/source/ui/app/docstyle.cxx
+++ b/sw/source/ui/app/docstyle.cxx
@@ -1034,15 +1034,7 @@ SfxItemSet&   SwDocStyleSheet::GetItemSet()
     switch(nFamily)
     {
         case SFX_STYLE_FAMILY_CHAR:
-            {
-                OSL_ENSURE(pCharFmt, "Where's SwCharFmt");
-                aCoreSet.Put(pCharFmt->GetAttrSet());
-
-                if(pCharFmt->DerivedFrom())
-                    aCoreSet.SetParent(&pCharFmt->DerivedFrom()->GetAttrSet());
-            }
-            break;
-        case SFX_STYLE_FAMILY_PARA :
+        case SFX_STYLE_FAMILY_PARA:
         case SFX_STYLE_FAMILY_FRAME:
             {
                 SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
@@ -1052,7 +1044,17 @@ SfxItemSet&   SwDocStyleSheet::GetItemSet()
                 aBoxInfo.SetDefDist( MIN_BORDER_DIST );// always set Default-Gap
                     // Single lines can only have DontCare-Status in tables
                 aBoxInfo.SetValid( VALID_DISABLE, sal_True );
-                if ( nFamily == SFX_STYLE_FAMILY_PARA )
+
+                if( nFamily == SFX_STYLE_FAMILY_CHAR )
+                {
+                    SAL_WARN_IF(!pCharFmt, "sw.app.docstyle", "Where's SwCharFmt");
+                    aCoreSet.Put(pCharFmt->GetAttrSet());
+                    aCoreSet.Put( aBoxInfo );
+
+                    if(pCharFmt->DerivedFrom())
+                        aCoreSet.SetParent(&pCharFmt->DerivedFrom()->GetAttrSet());
+                }
+                else if ( nFamily == SFX_STYLE_FAMILY_PARA )
                 {
                     OSL_ENSURE(pColl, "Where's Collection");
                     aCoreSet.Put(pColl->GetAttrSet());
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index ac6df95..510cbec 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -41,6 +41,7 @@
 
 #include <globals.hrc>
 #include <chrdlg.hrc>
+#include <chrdlgmodes.hxx>
 #include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
 #include <com/sun/star/ui/dialogs/XFilePicker.hpp>
 #include <SwStyleNameMapper.hxx>
@@ -58,11 +59,11 @@ using namespace ::com::sun::star::uno;
 using namespace ::sfx2;
 
 SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
-    const String* pStr, bool bIsDrwTxtDlg)
+    sal_uInt8 nDialogMode, const String* pStr)
     : SfxTabDialog(0, pParent, "CharacterPropertiesDialog",
         "modules/swriter/ui/characterproperties.ui", &rCoreSet, pStr != 0)
-    , rView(rVw)
-    , bIsDrwTxtMode(bIsDrwTxtDlg)
+    , m_rView(rVw)
+    , m_nDialogMode(nDialogMode)
 {
     if(pStr)
     {
@@ -80,9 +81,10 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
     m_nCharTwoId = AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), 0 );
     m_nCharUrlId = AddTabPage("hyperlink", SwCharURLPage::Create, 0);
     m_nCharBgdId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), 0 );
+    m_nCharBrdId = AddTabPage("borders", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), 0 );
 
     SvtCJKOptions aCJKOptions;
-    if(bIsDrwTxtMode)
+    if(m_nDialogMode == DLG_CHAR_DRAW || m_nDialogMode == DLG_CHAR_ANN)
     {
         RemoveTabPage(m_nCharUrlId);
         RemoveTabPage(m_nCharBgdId);
@@ -90,6 +92,9 @@ SwCharDlg::SwCharDlg(Window* pParent, SwView& rVw, const SfxItemSet& rCoreSet,
     }
     else if(!aCJKOptions.IsDoubleLinesEnabled())
         RemoveTabPage(m_nCharTwoId);
+
+    if(m_nDialogMode != DLG_CHAR_STD)
+        RemoveTabPage(m_nCharBrdId);
 }
 
 SwCharDlg::~SwCharDlg()
@@ -106,15 +111,15 @@ void SwCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
     if (nId == m_nCharStdId)
     {
         SvxFontListItem aFontListItem( *( (SvxFontListItem*)
-           ( rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) );
+           ( m_rView.GetDocShell()->GetItem( SID_ATTR_CHAR_FONTLIST ) ) ) );
         aSet.Put (SvxFontListItem( aFontListItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
-            if(!bIsDrwTxtMode)
-                aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
+        if(m_nDialogMode != DLG_CHAR_DRAW && m_nDialogMode != DLG_CHAR_ANN)
+            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_PREVIEW_CHARACTER));
         rPage.PageCreated(aSet);
     }
     else if (nId == m_nCharExtId)
     {
-        if(bIsDrwTxtMode)
+        if(m_nDialogMode == DLG_CHAR_DRAW || m_nDialogMode == DLG_CHAR_ANN)
             aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
 
         else
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 1ebe8a4..7d220dd 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -706,10 +706,10 @@ VclAbstractDialog   * SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView&
 
  // add for SwCharDlg
 SfxAbstractTabDialog *  SwAbstractDialogFactory_Impl::CreateSwCharDlg(Window* pParent, SwView& pVw,
-    const SfxItemSet& rCoreSet, const String* pFmtStr, sal_Bool bIsDrwTxtDlg)
+    const SfxItemSet& rCoreSet, sal_uInt8 nDialogMode, const String* pFmtStr)
 {
 
-    SfxTabDialog* pDlg = new SwCharDlg(pParent, pVw, rCoreSet, pFmtStr, bIsDrwTxtDlg);
+    SfxTabDialog* pDlg = new SwCharDlg(pParent, pVw, rCoreSet, nDialogMode, pFmtStr);
     return new AbstractTabDialog_Impl(pDlg);
 }
 
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 7d77e7f..060abef 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -444,7 +444,7 @@ public:
     virtual AbstractSwBreakDlg * CreateSwBreakDlg(Window *pParent, SwWrtShell &rSh); // add for SwBreakDlg
     virtual VclAbstractDialog   * CreateSwChangeDBDlg(SwView& rVw); //add for SwChangeDBDlg
     virtual SfxAbstractTabDialog *  CreateSwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
-        const String* pFmtStr = 0, sal_Bool bIsDrwTxtDlg = sal_False); // add for SwCharDlg
+        sal_uInt8 nDialogMode, const String* pFmtStr = 0); // add for SwCharDlg
     virtual AbstractSwConvertTableDlg* CreateSwConvertTableDlg(SwView& rView, bool bToTable); //add for SwConvertTableDlg
     virtual VclAbstractDialog * CreateSwCaptionDialog ( Window *pParent, SwView &rV,int nResId); //add for SwCaptionDialog
 
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index 462290c..5c5a3cf 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -36,6 +36,7 @@
 #include <envfmt.hxx>
 #include <fmtcol.hxx>
 #include "swuipardlg.hxx"
+#include <chrdlgmodes.hxx>
 #include <pattern.hxx>
 #include <poolfmt.hxx>
 #include <uitool.hxx>
@@ -304,7 +305,7 @@ IMPL_LINK( SwEnvFmtPage, EditHdl, MenuButton *, pButton )
             SwAbstractDialogFactory* pFact = swui::GetFactory();
             OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-            SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, &pColl->GetName());
+            SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg(GetParentSwEnvDlg(), pSh->GetView(), aTmpSet, DLG_CHAR_ENV, &pColl->GetName());
             OSL_ENSURE(pDlg, "Dialogdiet fail!");
             if (pDlg->Execute() == RET_OK)
             {
diff --git a/sw/source/ui/fmtui/tmpdlg.cxx b/sw/source/ui/fmtui/tmpdlg.cxx
index a6277f9..5def5e9 100644
--- a/sw/source/ui/fmtui/tmpdlg.cxx
+++ b/sw/source/ui/fmtui/tmpdlg.cxx
@@ -118,6 +118,9 @@ SwTemplateDlg::SwTemplateDlg(Window*            pParent,
             OSL_ENSURE(pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), "GetTabPageCreatorFunc fail!");
             OSL_ENSURE(pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) , "GetTabPageRangesFunc fail!");
             AddTabPage(TP_BACKGROUND, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BACKGROUND ) );
+            SAL_WARN_IF(!pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), "sw.fmtui", "GetTabPageCreatorFunc fail!");
+            SAL_WARN_IF(!pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ), "sw.fmtui", "GetTabPageRangesFunc fail!");
+            AddTabPage(TP_BORDER, pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER ), pFact->GetTabPageRangesFunc( RID_SVXPAGE_BORDER ) );
 
             SvtCJKOptions aCJKOptions;
             if(nHtmlMode & HTMLMODE_ON || !aCJKOptions.IsDoubleLinesEnabled())
diff --git a/sw/source/ui/fmtui/tmpdlg.src b/sw/source/ui/fmtui/tmpdlg.src
index 7766e97..0a6ae79 100644
--- a/sw/source/ui/fmtui/tmpdlg.src
+++ b/sw/source/ui/fmtui/tmpdlg.src
@@ -62,6 +62,12 @@ TabDialog DLG_TEMPLATE_1
                 Text [ en-US ] = "Background" ;
                 PageResID = TP_BACKGROUND ;
             };
+            PageItem
+            {
+                Identifier = TP_BORDER ;
+                Text [ en-US ] = "Borders" ;
+                PageResID = TP_BORDER ;
+            };
         };
     };
 };
diff --git a/sw/source/ui/inc/chrdlg.hxx b/sw/source/ui/inc/chrdlg.hxx
index 4eea02d..5962452 100644
--- a/sw/source/ui/inc/chrdlg.hxx
+++ b/sw/source/ui/inc/chrdlg.hxx
@@ -37,8 +37,8 @@ class SvxMacroItem;
 
 class SwCharDlg: public SfxTabDialog
 {
-    SwView&   rView;
-    bool bIsDrwTxtMode;
+    SwView&   m_rView;
+    sal_uInt8 m_nDialogMode;
 
     sal_uInt16 m_nCharStdId;
     sal_uInt16 m_nCharExtId;
@@ -46,10 +46,11 @@ class SwCharDlg: public SfxTabDialog
     sal_uInt16 m_nCharTwoId;
     sal_uInt16 m_nCharUrlId;
     sal_uInt16 m_nCharBgdId;
+    sal_uInt16 m_nCharBrdId;
 
 public:
     SwCharDlg(Window* pParent, SwView& pVw, const SfxItemSet& rCoreSet,
-              const String* pFmtStr = 0, bool bIsDrwTxtDlg = false);
+              sal_uInt8 nDialogMode, const String* pFmtStr = 0);
 
     ~SwCharDlg();
 
diff --git a/sw/source/ui/inc/chrdlgmodes.hxx b/sw/source/ui/inc/chrdlgmodes.hxx
new file mode 100644
index 0000000..4cbf007
--- /dev/null
+++ b/sw/source/ui/inc/chrdlgmodes.hxx
@@ -0,0 +1,21 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef SW_CHAR_DLG_MODES_HXX
+#define SW_CHAR_DLG_MODES_HXX
+
+//DialogModes:
+#define DLG_CHAR_STD    0
+#define DLG_CHAR_DRAW   1
+#define DLG_CHAR_ENV    2
+#define DLG_CHAR_ANN    3
+
+#endif // SW_CHAR_DLG_MODES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/annotsh.cxx b/sw/source/ui/shells/annotsh.cxx
index f1c54f1..3c8ceeb 100644
--- a/sw/source/ui/shells/annotsh.cxx
+++ b/sw/source/ui/shells/annotsh.cxx
@@ -77,6 +77,7 @@
 #include <wrtsh.hxx>
 #include <uitool.hxx>
 #include <popup.hrc>
+#include <chrdlgmodes.hxx>
 #include <pardlg.hxx>
 #include <swdtflvr.hxx>
 #include <drwtxtsh.hxx>
@@ -478,7 +479,7 @@ void SwAnnotationShell::Exec( SfxRequest &rReq )
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-                SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, 0, sal_True );
+                SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR_ANN);
                 OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if (nSlot == SID_CHAR_DLG_EFFECT)
                 {
diff --git a/sw/source/ui/shells/drwtxtex.cxx b/sw/source/ui/shells/drwtxtex.cxx
index 547ba2e..63684dc 100644
--- a/sw/source/ui/shells/drwtxtex.cxx
+++ b/sw/source/ui/shells/drwtxtex.cxx
@@ -84,6 +84,7 @@
 #include <hintids.hxx>
 #include <initui.hxx>               // for SpellPointer
 #include <langhelper.hxx>
+#include <chrdlgmodes.hxx>
 #include <pardlg.hxx>
 #include <shells.hrc>
 #include <string.h>
@@ -321,7 +322,7 @@ void SwDrawTextShell::Execute( SfxRequest &rReq )
                 SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
                 OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-                SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, 0, sal_True);
+                SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg(pView->GetWindow(), *pView, aDlgAttr, DLG_CHAR_DRAW);
                 OSL_ENSURE(pDlg, "Dialogdiet fail!");
                 if (nSlot == SID_CHAR_DLG_EFFECT)
                 {
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 4444d5a..65bf2a2 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -73,6 +73,7 @@
 #include <docsh.hxx>
 #include <mdiexp.hxx>
 #include <inputwin.hxx>
+#include <chrdlgmodes.hxx>
 #include <pardlg.hxx>
 #include <frmatr.hxx>
 #include <fmtcol.hxx>
@@ -138,6 +139,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
                         RES_CHRATR_BEGIN,      RES_CHRATR_END-1,
                         RES_TXTATR_INETFMT,    RES_TXTATR_INETFMT,
                         RES_BACKGROUND,        RES_BACKGROUND,
+                        SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
                         FN_PARAM_SELECTION,    FN_PARAM_SELECTION,
                         SID_HTML_MODE,         SID_HTML_MODE,
                         SID_ATTR_CHAR_WIDTH_FIT_TO_LINE,   SID_ATTR_CHAR_WIDTH_FIT_TO_LINE,
@@ -174,6 +176,9 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
         aCoreSet.Put( aTmpBrush );
     }
 
+    // Setting the BoxInfo
+    ::PrepareBoxInfo( aCoreSet, rWrtSh );
+
     aCoreSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(rWrtSh.GetView().GetDocShell())));
     SfxAbstractTabDialog* pDlg = NULL;
     if ( bUseDialog && GetActiveView() )
@@ -181,7 +186,7 @@ void sw_CharDialog( SwWrtShell &rWrtSh, bool bUseDialog, sal_uInt16 nSlot,const
         SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
         OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
 
-        pDlg = pFact->CreateSwCharDlg(rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet);
+        pDlg = pFact->CreateSwCharDlg(rWrtSh.GetView().GetWindow(), rWrtSh.GetView(), aCoreSet, DLG_CHAR_STD);
         OSL_ENSURE(pDlg, "Dialogdiet fail!");
         if( FN_INSERT_HYPERLINK == nSlot )
             pDlg->SetCurPageId("hyperlink");
diff --git a/sw/uiconfig/swriter/ui/characterproperties.ui b/sw/uiconfig/swriter/ui/characterproperties.ui
index 26be1b8..b0812a2 100644
--- a/sw/uiconfig/swriter/ui/characterproperties.ui
+++ b/sw/uiconfig/swriter/ui/characterproperties.ui
@@ -170,6 +170,20 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="borders">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Borders</property>
+              </object>
+              <packing>
+                <property name="position">6</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>


More information about the Libreoffice-commits mailing list