[Libreoffice-commits] core.git: Branch 'feature/gsoc-writer-char-borders' - 747 commits - accessibility/bridge accessibility/source android/experimental android/sdremote animations/source basctl/source basebmp/source basebmp/test basic/source bin/module-deps.pl bin/update_pch.sh boost/boost.wuninitialized.patch boost/UnpackedTarball_boost.mk canvas/source chart2/AllLangResTarget_chartcontroller.mk chart2/inc chart2/Library_chartcontroller.mk chart2/Library_chartcore.mk chart2/source chart2/uiconfig chart2/UIConfig_chart2.mk comphelper/source compilerplugins/clang config_host.mk.in configmgr/source configure.ac connectivity/Configuration_firebird.mk connectivity/Library_dbtools.mk connectivity/Library_firebird_sdbc.mk connectivity/Module_connectivity.mk connectivity/registry connectivity/source cppcanvas/source cppunit/unxlngx6 crashrep/CustomTarget_crashrep_res.mk cui/inc cui/Library_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/Library_dba.mk dbaccess/source desktop/Executa ble_sbase.mk desktop/Executable_scalc.mk desktop/Executable_sdraw.mk desktop/Executable_simpress.mk desktop/Executable_smath.mk desktop/Executable_soffice.mk desktop/Executable_sweb.mk desktop/Executable_swriter.mk desktop/Executable_unoinfo.mk desktop/Executable_unopkg.mk desktop/scripts desktop/source desktop/StaticLibrary_winextendloaderenv.mk desktop/StaticLibrary_winlauncher.mk desktop/test desktop/win32 dictionaries download.lst drawinglayer/inc drawinglayer/Library_drawinglayer.mk drawinglayer/source dtrans/source editeng/source embeddedobj/source epm/epm-3.7.patch extensions/source extras/source filter/Library_ips.mk filter/Library_placeware.mk filter/Library_xsltfilter.mk filter/source firebird/ExternalPackage_firebird.mk firebird/ExternalProject_firebird.mk firebird/firebird-c++11.patch.1 firebird/firebird-cygwin-msvc.patch.1 firebird/firebird-icu.patch.1 firebird/firebird-macosx.patch.1 firebird/Makefile firebird/Module_firebird.mk firebird/UnpackedTarball_firebir d.mk forms/source framework/inc framework/Library_fwk.mk framework/qa framework/source framework/uiconfig framework/UIConfig_startmodule.mk g .gitignore helpcontent2 i18nlangtag/source i18npool/source icon-themes/crystal icon-themes/galaxy icon-themes/hicontrast icon-themes/human icon-themes/oxygen include/basebmp include/connectivity include/drawinglayer include/editeng include/i18nlangtag include/oox include/sal include/sax include/sfx2 include/svl include/svtools include/svx include/toolkit include/tools include/unotools include/vcl include/xmloff instsetoo_native/CustomTarget_install.mk ios/iosremote l10ntools/source languagetool/MessageBox-apichange.patch languagetool/UnpackedTarball_languagetool.mk libatomic_ops/ExternalPackage_libatomic_ops.mk libatomic_ops/ExternalProject_libatomic_ops.mk libatomic_ops/Makefile libatomic_ops/Module_libatomic_ops.mk libatomic_ops/README libatomic_ops/UnpackedTarball_libatomic_ops.mk liblangtag/liblangtag-0.5.1-vsnprintf.patch Library_ merged.mk librelogo/source libvisio/libvisio-0.0.29-remove_whitespace.patch.1 libvisio/libvisio-0.0.30-msvc.patch.1 libvisio/UnpackedTarball_libvisio.mk lingucomponent/source linguistic/source lpsolve/lp_solve_5.5-windows.patch lpsolve/UnpackedTarball_lpsolve.mk Makefile.fetch odk/examples odk/Package_examples.mk odk/settings offapi/com offapi/type_reference offapi/UnoApi_offapi.mk officecfg/registry oox/source poppler/ExternalProject_poppler.mk poppler/poppler-mac-fake.patch.1 poppler/UnpackedTarball_poppler.mk postprocess/CustomTarget_images.mk postprocess/CustomTarget_registry.mk postprocess/Rdb_services.mk pyuno/Executable_python_wrapper.mk pyuno/source qadevOOo/tests readlicense_oo/docs reportdesign/source RepositoryExternal.mk Repository.mk RepositoryModule_host.mk sal/osl sal/qa sal/workben sax/CppunitTest_sax.mk sax/qa sax/source scaddins/source sc/AllLangResTarget_sc.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/Library_scfilt.mk sc/Library_sc.mk sc/Library_scqahelper.mk sc/Library_vbaobj.mk sc/Module_sc.mk scp2/InstallModule_firebird.mk scp2/InstallScript_setup_osl.mk scp2/Module_scp2.mk scp2/source sc/qa scripting/Library_stringresource.mk scripting/source sc/sdi sc/source sc/uiconfig sc/UIConfig_scalc.mk sd/AllLangResTarget_sd.mk sdext/Executable_xpdfimport.mk sdext/source sd/inc sd/Library_sd.mk sd/qa sd/source sd/uiconfig sd/UIConfig_sdraw.mk setup_native/CustomTarget_mac.mk setup_native/scripts setup_native/source sfx2/inc sfx2/Library_sfx.mk sfx2/source sfx2/uiconfig sfx2/UIConfig_sfx.mk shell/CppunitTest_shell_zip.mk shell/CustomTarget_shlxthdl_res.mk shell/Executable_regsvrex.mk shell/inc shell/Module_shell.mk shell/qa shell/source slideshow/inc slideshow/Library_slideshow.mk slideshow/source slideshow/test smoketest/CppunitTest_smoketest.mk solenv/bin solenv/doc solenv/gbuild solenv/gcc-wrappers soltools/cpp sot/source starmath/inc starmath/qa starmath/source starmath/uiconfig stoc/source store/source svgio/source svl/source svtool s/inc svtools/langsupport svtools/Library_svt.mk svtools/source svx/AllLangResTarget_svx.mk svx/inc svx/Library_svxcore.mk svx/Library_svx.mk svx/source svx/uiconfig svx/UIConfig_svx.mk sw/AllLangResTarget_sw.mk sw/CppunitTest_sw_filters_test.mk swext/mediawiki sw/inc sw/Library_swui.mk sw/Library_vbaswobj.mk sw/qa sw/sdi sw/source sw/uiconfig sw/UIConfig_swriter.mk sysui/CustomTarget_deb.mk sysui/CustomTarget_infoplist.mk sysui/CustomTarget_share.mk sysui/desktop sysui/Module_sysui.mk toolkit/source tools/Library_tl.mk tools/source translations ucb/source udkapi/com UnoControls/inc UnoControls/source unodevtools/source unoidl/source unotools/source unusedcode.easy vcl/android vcl/aqua vcl/coretext vcl/generic vcl/headless vcl/inc vcl/ios vcl/Library_vcl.mk vcl/source vcl/unx vcl/win writerfilter/qa writerfilter/source writerperfect/source xmloff/inc xmloff/source xmlscript/Library_xmlscript.mk xmlscript/source xmlsecurity/inc xmlsecurity/source xmlsecurity/uiconfig

Zolnai Tamás zolnaitamas2000 at gmail.com
Mon Jul 22 13:24:02 PDT 2013


Rebased ref, commits from common ancestor:
commit 61a69044b0cfadef0f5f7a3493cb95d6e4ef3844
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 a162a24..cdb6596 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;
 }
 
@@ -1608,6 +1615,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 08de7c860e12d24932a3be8bd069708b108c8a0a
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 584bdbd3698ceca186599405dcaad9f89db10067
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 313bf9f0feea8096d2d840a3354b76e9d3cac708
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 b6d6ca9770b9078d211f38724149c3f795446096
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 83afbcd..3a26776 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 4e57193..4847552 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -287,7 +287,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
@@ -495,9 +495,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 );
@@ -692,7 +690,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 ee28a6b..7d1cd37 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3672,7 +3672,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 25581eb..f271019 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 f56298f9923046fd2cb5cbddc58b9d622c6ca6f3
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>
commit 7f653884f96b90d5da5a85487234a7e7182df3fa
Author: Andrzej J.R. Hunt <andrzej at ahunt.org>
Date:   Mon Jul 22 20:22:27 2013 +0200

    Hopefully the last ambiguous conversion fix (firebird-sdbc).
    
    Change-Id: If290239444f4849e3f5355a3c0a64416fc5c691d

diff --git a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
index 35fa88e..3545970 100644
--- a/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/FDatabaseMetaData.cxx
@@ -1039,7 +1039,7 @@ uno::Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
             short aColumnNumber = xRow->getShort(5);
             // Firebird stores column numbers beginning with 0 internally
             // SDBC expects column numbering to begin with 1.
-            aCurrentRow.push_back(new ORowSetValueDecorator(aColumnNumber + 1));
+            aCurrentRow.push_back(new ORowSetValueDecorator(sal_Int32(aColumnNumber + 1)));
         }
         // 18. Is nullable
         if (xRow->getShort(9))
commit ea79b364499d7d9df06fb0cd048f53a38b95077b
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Tue Jul 9 12:41:33 2013 +0200

    Decrease scope of some variable
    
    Change-Id: I23319e09bf6c4c0e33b86edc225cdfaa0433b7c6

diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b19da71..6d99fd3 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4673,9 +4673,6 @@ static void lcl_PaintLeftRightLine( const bool         _bLeft,
     {
         pLeftRightBorder = bR2L ? rBox.GetLeft() : rBox.GetRight();
     }
-    // OD 06.05.2003 #107169# - init boolean indicating printer output device.
-    const bool bPrtOutputDev =
-            ( OUTDEV_PRINTER == pGlobalShell->GetOut()->GetOutDevType() );
 
     if ( !pLeftRightBorder )
     {
@@ -4694,9 +4691,7 @@ static void lcl_PaintLeftRightLine( const bool         _bLeft,
                                       (aRect.*_rRectFn->fnGetWidth)() );
     }
 
-    const sal_Bool bCnt = _rFrm.IsCntntFrm();
-
-    if ( bCnt )
+    if ( _rFrm.IsCntntFrm() )
     {
         ::lcl_ExtendLeftAndRight( aRect, _rFrm, _rAttrs, _rRectFn );
 
@@ -4707,6 +4702,10 @@ static void lcl_PaintLeftRightLine( const bool         _bLeft,
 
     if ( !pLeftRightBorder->GetInWidth() )
     {
+        // OD 06.05.2003 #107169# - init boolean indicating printer output device.
+        const bool bPrtOutputDev =
+                ( OUTDEV_PRINTER == pGlobalShell->GetOut()->GetOutDevType() );
+
         // OD 06.05.2003 #107169# - add 6th parameter
         ::lcl_SubTopBottom( aRect, rBox, _rAttrs, _rFrm, _rRectFn, bPrtOutputDev );
     }
@@ -4730,8 +4729,7 @@ static void lcl_PaintTopBottomLine( const bool         _bTop,
 {
     const SvxBoxItem& rBox = _rAttrs.GetBox();
     const SvxBorderLine* pTopBottomBorder = 0;
-    const SvxBorderLine* pLeftBorder = rBox.GetLeft();
-    const SvxBorderLine* pRightBorder = rBox.GetRight();
+
     if ( _bTop )
     {
         pTopBottomBorder = rBox.GetTop();
@@ -4761,7 +4759,7 @@ static void lcl_PaintTopBottomLine( const bool         _bTop,
     if ( lcl_GetLineWidth( pTopBottomBorder ) > 0 )
     {
         lcl_MakeBorderLine(
-            aRect, false, _bTop, *pTopBottomBorder, pLeftBorder, pRightBorder);
+            aRect, false, _bTop, *pTopBottomBorder, rBox.GetLeft(), rBox.GetRight());
     }
 }
 
commit 3b7030d99580aa70dad884b1ac74924d9a179b3e
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Sun Jul 7 21:13:55 2013 +0200

    Update comment
    
    Change-Id: I26dd6b741b538da1c372534b55870c22ebd3d046

diff --git a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx
index d03e749..c0f225e 100644
--- a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx
+++ b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx
@@ -37,9 +37,9 @@ namespace drawinglayer
         /** BorderLinePrimitive2D class
 
             This is the basic primitive to build frames around objects, e.g. tables.
-            It defines a single or double line from Start to nd using the LeftWidth,
+            It defines a single or double line from Start to End using the LeftWidth,
             Distance and RightWidth definitions.
-            The LineStart/End overlap is defined by the Extend(Inner|Outer)(Start|End)
+            The LineStart/End overlap is defined by the Extend(Left|Right)(Start|End)
             definitions.
          */
         class DRAWINGLAYER_DLLPUBLIC BorderLinePrimitive2D : public BufferedDecompositionPrimitive2D
commit c83be01ded8090f0d7cdfe3f279b695f2307803e
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Sun Jul 7 20:24:11 2013 +0200

    Remove useless private operator==() from SwFont
    
    Change-Id: I7cbc6cc1c55afe0906cacda571c9ed8dd7fd8dd7

diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index 00a147d..a023dc2 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -62,7 +62,6 @@ class SwSubFont : public SvxFont
     inline void CopyMagic( const SwSubFont& rFnt )
         { pMagic = rFnt.pMagic; nFntIndex = rFnt.nFntIndex; }
 
-    sal_Bool operator==( const SwFont &rFnt ) const;
     SwSubFont& operator=( const SwSubFont &rFont );
 
     short _CheckKerning( );
@@ -144,8 +143,6 @@ class SwFont
     sal_Bool bGreyWave      :1;  // Fuers extended TextInput: Graue Wellenlinie
     sal_Bool bNoColReplace  :1;  // Replacement without colormanipulation
 
-    sal_Bool operator==( const SwFont &rFnt ) const;
-
 protected:
     inline SwFont() { pBackColor = NULL; nActual = SW_LATIN; }
 
commit 979854a5fe7843ba4312285c5b245a89692e6c51
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Wed Jun 26 15:47:58 2013 +0200

    Remove useless variable
    
    Change-Id: I78004d9d74647ad9b87975204844cb2bb66a83fa

diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 8a134520..4444d5a 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -887,8 +887,6 @@ void SwTextShell::Execute(SfxRequest &rReq)
             if ( !pPaM )
                 pPaM = rWrtSh.GetCrsr();
 
-            bool bUseCurCrsr = true;
-
             FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, &GetView()));
             SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
 
@@ -934,9 +932,8 @@ void SwTextShell::Execute(SfxRequest &rReq)
             SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff );
             aCoreSet.Put( aOff );
 
-            // Setting the BoxInfo if based on the current cursor
-            if ( bUseCurCrsr )
-                ::PrepareBoxInfo( aCoreSet, rWrtSh );
+            // Setting the BoxInfo
+            ::PrepareBoxInfo( aCoreSet, rWrtSh );
 
             // Current page format
             ::SwToSfxPageDescAttr( aCoreSet );
commit ca62ff029158cb8543d19324cc721773b2185e20
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Fri Jun 21 16:01:18 2013 +0200

    Fix indentation
    
    Change-Id: I4feae9998647694efaad776396aca2ce8f177152

diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index 5e4360d..8a134520 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -968,13 +968,13 @@ void SwTextShell::Execute(SfxRequest &rReq)
             if ( !bUseDialog )
             {
                 if ( nSlot == SID_ATTR_PARA_LRSPACE)
-        {
-            SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)pArgs->Get(nSlot));
-            aParaMargin.SetWhich( RES_LR_SPACE);
-            aCoreSet.Put(aParaMargin);
-            pSet = &aCoreSet;
+                {
+                    SvxLRSpaceItem aParaMargin((const SvxLRSpaceItem&)pArgs->Get(nSlot));
+                    aParaMargin.SetWhich( RES_LR_SPACE);
+                    aCoreSet.Put(aParaMargin);
+                    pSet = &aCoreSet;
 
-        } else
+                } else
                     pSet = (SfxItemSet*) pArgs;
 
             }
commit 8560fb88c7252e5ad60674e447f2e194298f08de
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Jun 20 15:38:01 2013 +0200

    Remove obsolote border dialog
    
    Change-Id: I57f3db05a21caeff04f280a0c13c3facfe23c3c1

diff --git a/icon-themes/crystal/cmd/lc_borderdialog.png b/icon-themes/crystal/cmd/lc_borderdialog.png
deleted file mode 100644
index c0ca4f6..0000000
Binary files a/icon-themes/crystal/cmd/lc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/crystal/cmd/sc_borderdialog.png b/icon-themes/crystal/cmd/sc_borderdialog.png
deleted file mode 100644
index 6b6ab48..0000000
Binary files a/icon-themes/crystal/cmd/sc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/galaxy/cmd/lc_borderdialog.png b/icon-themes/galaxy/cmd/lc_borderdialog.png
deleted file mode 100644
index 0cd8935..0000000
Binary files a/icon-themes/galaxy/cmd/lc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/galaxy/cmd/sc_borderdialog.png b/icon-themes/galaxy/cmd/sc_borderdialog.png
deleted file mode 100644
index c8b915b..0000000
Binary files a/icon-themes/galaxy/cmd/sc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/hicontrast/cmd/lc_borderdialog.png b/icon-themes/hicontrast/cmd/lc_borderdialog.png
deleted file mode 100644
index a61a1a6..0000000
Binary files a/icon-themes/hicontrast/cmd/lc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/hicontrast/cmd/sc_borderdialog.png b/icon-themes/hicontrast/cmd/sc_borderdialog.png
deleted file mode 100644
index 6c65b36..0000000
Binary files a/icon-themes/hicontrast/cmd/sc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/human/cmd/lc_borderdialog.png b/icon-themes/human/cmd/lc_borderdialog.png
deleted file mode 100644
index 323a8df..0000000
Binary files a/icon-themes/human/cmd/lc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/human/cmd/sc_borderdialog.png b/icon-themes/human/cmd/sc_borderdialog.png
deleted file mode 100644
index d71ad45..0000000
Binary files a/icon-themes/human/cmd/sc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/oxygen/cmd/lc_borderdialog.png b/icon-themes/oxygen/cmd/lc_borderdialog.png
deleted file mode 100644
index c0ca4f6..0000000
Binary files a/icon-themes/oxygen/cmd/lc_borderdialog.png and /dev/null differ
diff --git a/icon-themes/oxygen/cmd/sc_borderdialog.png b/icon-themes/oxygen/cmd/sc_borderdialog.png
deleted file mode 100644
index 6b6ab48..0000000
Binary files a/icon-themes/oxygen/cmd/sc_borderdialog.png and /dev/null differ
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index c8dc745..76ff150 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -829,14 +829,6 @@
           <value xml:lang="en-US">Name...</value>
         </prop>
       </node>
-      <node oor:name=".uno:BorderDialog" oor:op="replace">
-        <prop oor:name="Label" oor:type="xs:string">
-          <value xml:lang="en-US">Borders</value>
-        </prop>
-        <prop oor:name="Properties" oor:type="xs:int">
-          <value>1</value>
-        </prop>
-      </node>
       <node oor:name=".uno:PageColumnDialog" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Page Columns</value>
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index bec90c2..2f1d4bc 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -118,7 +118,6 @@ $(eval $(call gb_Library_add_exception_objects,swui,\
     sw/source/ui/frmdlg/frmdlg \
     sw/source/ui/frmdlg/frmpage \
     sw/source/ui/frmdlg/pattern \
-    sw/source/ui/frmdlg/uiborder \
     sw/source/ui/frmdlg/wrap \
     sw/source/ui/index/cntex \
     sw/source/ui/index/cnttab \
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index dee921d..94b8351 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -323,7 +323,6 @@ included in c-context files, so c++ style stuff will cause problems.
 
 #define FN_FORMAT_PAGE_SETTING_DLG  (FN_FORMAT + 42)  /*  */
 #define FN_NUM_FORMAT_TABLE_DLG     (FN_FORMAT + 45)  /* number format in table */
-#define FN_FORMAT_BORDER_DLG        (FN_FORMAT + 48)  /* */
 #define FN_FORMAT_PAGE_COLUMN_DLG   (FN_FORMAT + 49)  /* columns per page */
 #define FN_FORMAT_BACKGROUND_DLG    (FN_FORMAT + 50)  /* background */
 #define FN_FORMAT_PAGE_DLG          (FN_FORMAT + 52)  /* page */
diff --git a/sw/inc/dialog.hrc b/sw/inc/dialog.hrc
index 802a66f..902404f 100644
--- a/sw/inc/dialog.hrc
+++ b/sw/inc/dialog.hrc
@@ -56,7 +56,6 @@
 #define RC_DLG_ADDR         (RC_DIALOG_BEGIN + 90)
 #define RC_SWDLG_BACKGROUND     (RC_DIALOG_BEGIN + 91)
 #define RC_DLG_SWNUMFMTDLG      (RC_DIALOG_BEGIN + 92)
-#define RC_DLG_SWBORDERDLG      (RC_DIALOG_BEGIN + 93)
 #define RC_DLG_SWWRAPDLG        (RC_DIALOG_BEGIN + 94)
 #define RC_DLG_SWFLDEDITDLG     (RC_DIALOG_BEGIN + 95)
 // Ueberlaufpruefung ********************************************************
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 4f48dad..de82751 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -377,7 +377,6 @@ public:
     virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg
                                                             sal_Bool bSetAutoFmt = sal_True,
                                                             const SwTableAutoFmt* pSelFmt = 0 ) = 0;
-    virtual SfxAbstractDialog * CreateSwBorderDlg ( Window* pParent, SfxItemSet& rSet, sal_uInt16 nType, int nResId ) = 0;//add for SwBorderDlg
     virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ) = 0; //add for SwWrapDlg
 
     virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc) = 0; //add for SwTableWidthDlg
diff --git a/sw/sdi/_basesh.sdi b/sw/sdi/_basesh.sdi
index 4b87dab..060ec16 100644
--- a/sw/sdi/_basesh.sdi
+++ b/sw/sdi/_basesh.sdi
@@ -275,11 +275,6 @@ interface BaseTextSelection
         StateMethod = GetState ;
         DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
     ]
-    FN_FORMAT_BORDER_DLG // status(final|play)
-    [
-        ExecMethod = ExecDlg ;
-        DisableFlags="SW_DISABLE_ON_PROTECTED_CURSOR";
-    ]
 
     SID_ATTR_BORDER_INNER // status()
     [
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index c5b7326..1949ecc 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -624,31 +624,6 @@ SfxVoidItem SwBackspace FN_BACKSPACE
 ]
 
 //--------------------------------------------------------------------------
-SfxVoidItem BorderDialog FN_FORMAT_BORDER_DLG
-()
-[
-    /* flags: */
-    AutoUpdate = FALSE,
-    Cachable = Cachable,
-    FastCall = TRUE,
-    HasCoreId = FALSE,
-    HasDialog = TRUE,
-    ReadOnlyDoc = FALSE,
-    Toggle = FALSE,
-    Container = FALSE,
-    RecordAbsolute = FALSE,
-    RecordPerSet;
-    Asynchron;
-
-    /* config: */
-    AccelConfig = TRUE,
-    MenuConfig = TRUE,
-    StatusBarConfig = FALSE,
-    ToolBoxConfig = TRUE,
-    GroupId = GID_FORMAT;
-]
-
-//--------------------------------------------------------------------------
 SfxVoidItem BulletsAndNumberingDialog FN_NUMBER_BULLETS
 ()
 [
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 16c61b1..1ebe8a4 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -59,7 +59,6 @@
 #include "srtdlg.hxx" //add for SwSortDlg
 #include "tautofmt.hxx" //add for SwAutoFormatDlg
 #include "tblnumfm.hxx" //add for SwNumFmtDlg
-#include "uiborder.hxx" //add for SwBorderDlg
 #include "wrap.hxx" //add for SwWrapDlg
 #include "colwd.hxx" //add for SwTableWidthDlg
 #include "tabledlg.hxx" //add for SwTableTabDlg
@@ -184,7 +183,7 @@ sal_uInt8 AbstractSwInsertAbstractDlg_Impl::GetPara() const
     return pDlg->GetPara();
 }
 
-//add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwBorderDlg SwWrapDlg  SwFldEditDlg begin
+//add for SwAddrDlg, SwDropCapsDlg ,SwBackgroundDlg, SwNumFmtDlg SwWrapDlg  SwFldEditDlg begin
 const SfxItemSet* SwAbstractSfxDialog_Impl::GetOutputItemSet() const
 {
     return pDlg->GetOutputItemSet();
@@ -885,23 +884,6 @@ AbstractSwAutoFormatDlg * SwAbstractDialogFactory_Impl::CreateSwAutoFormatDlg(Wi
     return new AbstractSwAutoFormatDlg_Impl(pDlg);
 }
 
-SfxAbstractDialog * SwAbstractDialogFactory_Impl::CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId )
-{
-    SfxModalDialog* pDlg=NULL;
-    switch ( nResId )
-    {
-        case RC_DLG_SWBORDERDLG :
-            pDlg = new SwBorderDlg( pParent, rSet, nType );
-            break;
-        default:
-            break;
-    }
-
-    if ( pDlg )
-        return new SwAbstractSfxDialog_Impl( pDlg );
-    return 0;
-}
-
 SfxAbstractDialog* SwAbstractDialogFactory_Impl::CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId )
 {
     SfxModalDialog* pDlg=NULL;
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index ff9ee11..7d77e7f 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -84,7 +84,7 @@ class AbstractSwInsertAbstractDlg_Impl : public AbstractSwInsertAbstractDlg
 
 //add for SwInsertAbstractDlg end
 
-// add for SwAddrDlg, SwDropCapsDlg, SwBackgroundDlg SwNumFmtDlg  SwWrapDlg SwBorderDlg, SwFldEditDlg  begin
+// add for SwAddrDlg, SwDropCapsDlg, SwBackgroundDlg SwNumFmtDlg  SwWrapDlg, SwFldEditDlg  begin
 class SfxNoLayoutSingleTabDialog;
 class SwAbstractSfxDialog_Impl :public SfxAbstractDialog
 {
@@ -93,7 +93,7 @@ class SwAbstractSfxDialog_Impl :public SfxAbstractDialog
     virtual void        SetText( const OUString& rStr );
     virtual OUString    GetText() const;
 };
-// add for SwAddrDlg,SwDropCapsDlg , SwBackgroundDlg  SwNumFmtDlg SwWrapDlg SwBorderDlg, SwFldEditDlg  end
+// add for SwAddrDlg,SwDropCapsDlg , SwBackgroundDlg  SwNumFmtDlg SwWrapDlg, SwFldEditDlg  end
 
 // add for SwAsciiFilterDlg begin
 class AbstractSwAsciiFilterDlg_Impl : public AbstractSwAsciiFilterDlg
@@ -477,7 +477,6 @@ public:
     virtual AbstractSwAutoFormatDlg * CreateSwAutoFormatDlg( Window* pParent, SwWrtShell* pShell, //add for SwAutoFormatDlg
                                                             sal_Bool bSetAutoFmt = sal_True,
                                                             const SwTableAutoFmt* pSelFmt = 0 );
-    virtual SfxAbstractDialog * CreateSwBorderDlg (Window* pParent, SfxItemSet& rSet, sal_uInt16 nType,int nResId );//add for SwBorderDlg
 
     virtual SfxAbstractDialog * CreateSwWrapDlg ( Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode, int nResId ); //add for SwWrapDlg
     virtual VclAbstractDialog * CreateSwTableWidthDlg(Window *pParent, SwTableFUNC &rFnc);
diff --git a/sw/source/ui/envelp/envfmt.cxx b/sw/source/ui/envelp/envfmt.cxx
index b98334f..462290c 100644
--- a/sw/source/ui/envelp/envfmt.cxx
+++ b/sw/source/ui/envelp/envfmt.cxx
@@ -38,7 +38,6 @@
 #include "swuipardlg.hxx"
 #include <pattern.hxx>
 #include <poolfmt.hxx>
-#include <uiborder.hxx>
 #include <uitool.hxx>
 
 #include <envfmt.hrc>
diff --git a/sw/source/ui/frmdlg/frmui.src b/sw/source/ui/frmdlg/frmui.src
index 0cf431b..679fc12 100644
--- a/sw/source/ui/frmdlg/frmui.src
+++ b/sw/source/ui/frmdlg/frmui.src
@@ -102,10 +102,6 @@ String STR_COLL_HEADER
 {
     Text [ en-US ] = " (Template: " ;
 };
-String STR_FRMUI_BORDER
-{
-    Text [ en-US ] = "Borders" ;
-};
 String STR_FRMUI_PATTERN
 {
     Text [ en-US ] = "Background" ;
diff --git a/sw/source/ui/frmdlg/uiborder.cxx b/sw/source/ui/frmdlg/uiborder.cxx
deleted file mode 100644
index 2f4b1ef..0000000
--- a/sw/source/ui/frmdlg/uiborder.cxx
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <svx/svxdlg.hxx>
-#include <svx/svxids.hrc>
-#include <svx/dialogs.hrc>
-#include <svl/itemset.hxx>
-#include <svx/flagsdef.hxx>
-#include <sfx2/tabdlg.hxx>
-#include <svl/intitem.hxx>
-
-#include "swtypes.hxx"
-#include "uiborder.hxx"
-#include "frmui.hrc"
-
-
-
-
-SwBorderDlg::SwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType) :
-
-    SfxNoLayoutSingleTabDialog(pParent, rSet, 0)
-
-{
-    SetText(SW_RESSTR(STR_FRMUI_BORDER));
-
-    // create TabPage
-    SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
-    OSL_ENSURE(pFact, "Dialogdiet fail!");
-    ::CreateTabPage fnCreatePage = pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BORDER );
-    if ( fnCreatePage )
-    {
-        SfxTabPage* pNewPage = (*fnCreatePage)( this, rSet );
-        SfxAllItemSet aSet(*(rSet.GetPool()));
-        aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE,nType));
-        if(SW_BORDER_MODE_TABLE == nType)
-            aSet.Put (SfxUInt32Item(SID_FLAG_TYPE,SVX_HIDESHADOWCTL));
-        pNewPage->PageCreated(aSet);
-        SetTabPage(pNewPage);
-    }
-}
-
-
-
-SwBorderDlg::~SwBorderDlg()
-{
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/inc/frmui.hrc b/sw/source/ui/inc/frmui.hrc
index 612a32b..cc03279 100644
--- a/sw/source/ui/inc/frmui.hrc
+++ b/sw/source/ui/inc/frmui.hrc
@@ -45,7 +45,6 @@
 
 #define STR_TOPPRT              (STR_FRMDLG_BEGIN + 1)
 
-#define STR_BORDER              (STR_FRMDLG_BEGIN + 16)
 #define STR_COLUMN              (STR_FRMDLG_BEGIN + 17)
 #define STR_CHAR                (STR_FRMDLG_BEGIN + 19)
 
diff --git a/sw/source/ui/inc/uiborder.hxx b/sw/source/ui/inc/uiborder.hxx
deleted file mode 100644
index 20e5e87..0000000
--- a/sw/source/ui/inc/uiborder.hxx
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-#ifndef _UIBORDER_HXX
-#define _UIBORDER_HXX
-
-
-#include <sfx2/basedlgs.hxx>
-class Window;
-class SfxItemSet;
-
-class SwBorderDlg : public SfxNoLayoutSingleTabDialog
-{
-public:
-
-     // nType may be:
-     // SW_BORDER_MODE_PARA
-     // SW_BORDER_MODE_TABLE
-     // SW_BORDER_MODE_FRAME
-
-     SwBorderDlg(Window* pParent, SfxItemSet& rSet, sal_uInt16 nType);
-    ~SwBorderDlg();
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/ui/shells/basesh.cxx b/sw/source/ui/shells/basesh.cxx
index ea1f6a6..67087fb 100644
--- a/sw/source/ui/shells/basesh.cxx
+++ b/sw/source/ui/shells/basesh.cxx
@@ -2358,73 +2358,6 @@ void SwBaseShell::ExecDlg(SfxRequest &rReq)
             }
         }
         break;
-        case FN_FORMAT_BORDER_DLG:
-        {
-            SfxItemSet   aSet( rSh.GetAttrPool(),
-                               RES_BOX              , RES_SHADOW,
-                               SID_ATTR_BORDER_INNER, SID_ATTR_BORDER_INNER,
-                               0 );
-            SfxAbstractDialog * pDlg = 0;
-            // Table cell(s) selected?
-            if ( rSh.IsTableMode() )
-            {
-                // Set border attributes Get/SetTabBorders()
-                ::PrepareBoxInfo( aSet, rSh );
-                rSh.GetTabBorders( aSet );
-                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
-
-                pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_TABLE, RC_DLG_SWBORDERDLG );
-                OSL_ENSURE(pDlg, "Dialogdiet fail!");
-                if ( pDlg->Execute() == RET_OK )
-                {
-                    rSh.SetTabBorders( *pDlg->GetOutputItemSet() );
-                    pOutSet = pDlg->GetOutputItemSet();
-                }
-            }
-            else if ( rSh.IsFrmSelected() )
-            {
-                // Set border attributes via Frame-Manager
-                SwFlyFrmAttrMgr aMgr( sal_False, &rSh, FRMMGR_TYPE_NONE );
-                aSet.Put( aMgr.GetAttrSet() );
-
-                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
-
-                pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_FRAME, RC_DLG_SWBORDERDLG );
-                OSL_ENSURE(pDlg, "Dialogdiet fail!");
-                if ( pDlg->Execute() == RET_OK )
-                {
-                    aMgr.SetAttrSet( *pDlg->GetOutputItemSet() );
-                    aMgr.UpdateFlyFrm();
-                    pOutSet = pDlg->GetOutputItemSet();
-                }
-            }
-            else
-            {
-                // Set border attributes via Shell quite normal
-                rSh.GetCurAttr( aSet );
-                ::PrepareBoxInfo( aSet, rSh );
-
-                SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
-                OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
-
-                pDlg = pFact->CreateSwBorderDlg( pMDI, aSet, SW_BORDER_MODE_PARA, RC_DLG_SWBORDERDLG );
-                OSL_ENSURE(pDlg, "Dialogdiet fail!");
-                if ( pDlg->Execute() == RET_OK )
-                {
-                    rSh.SetAttr( *pDlg->GetOutputItemSet() );
-                    pOutSet = pDlg->GetOutputItemSet();
-                }
-            }
-            if(pOutSet)
-            {
-                rReq.Done(*pOutSet);
-                bDone = true;
-            }
-            delete pDlg;
-        }
-        break;
         case FN_FORMAT_BACKGROUND_DLG:
         {
             SfxItemSet aSet( rSh.GetAttrPool(),
commit df685a3faacd5952ea6dca373c7f304dbfb43e4c
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Thu Jun 20 11:32:04 2013 +0200

    Page border bug: margin edits are enable when no broder
    
    To reproduce
    1. Format -> Page
    2. Set left and ritght borders only (All margins is editable)
    4. Set inner margins bigger (using syncronize check box), for example 2 cm
    5. Click OK
    
    Result
    Margin appaer just on the right and the left side, so just on those
    sides where there is a border.
    
    Expected:
    Only the relevant edits must be enable on border tab page
    just as in case of paragraph borders.
    
    Note to fix:
    Inner margin without border is used only for table, but not

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list