[Libreoffice-commits] core.git: Branch 'feature/gsoc-writer-char-borders' - 3 commits - include/drawinglayer sw/inc sw/source

Zolnai Tamás zolnaitamas2000 at gmail.com
Sun Jul 7 11:19:11 PDT 2013


 include/drawinglayer/primitive2d/borderlineprimitive2d.hxx |    4 
 sw/inc/charatr.hxx                                         |    4 
 sw/inc/format.hxx                                          |    1 
 sw/inc/hintids.hxx                                         |    4 
 sw/inc/swatrset.hxx                                        |    1 
 sw/source/core/bastyp/init.cxx                             |    9 -
 sw/source/core/doc/dbgoutsw.cxx                            |    1 
 sw/source/core/inc/swfntcch.hxx                            |    2 
 sw/source/core/inc/swfont.hxx                              |   26 ++-
 sw/source/core/text/atrhndl.hxx                            |    2 
 sw/source/core/text/atrstck.cxx                            |   21 +-
 sw/source/core/txtnode/swfont.cxx                          |  100 ++++++++++++-
 sw/source/filter/html/css1atr.cxx                          |    2 
 sw/source/filter/html/htmlatr.cxx                          |    2 
 sw/source/ui/app/docst.cxx                                 |   31 ++++
 sw/source/ui/fmtui/tmpdlg.cxx                              |    1 
 sw/source/ui/shells/textsh1.cxx                            |   25 +++
 17 files changed, 209 insertions(+), 27 deletions(-)

New commits:
commit 2c75de33a77991d99036e0789663362f04d00d5b
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 51ec7490acbd68efff2587fb676101296d1311cf
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 e6af8f9..f260c64 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
@@ -494,9 +494,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 );
@@ -691,7 +689,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 6beb0e0..861de97 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 5a348e4..3833c24 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3717,7 +3717,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 34514eb..b9bd549 100644
--- a/sw/source/filter/html/htmlatr.cxx
+++ b/sw/source/filter/html/htmlatr.cxx
@@ -3234,7 +3234,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 bdb823a..0d37c72 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 e88b3c8..19df356 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 68f5a19..4632270 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 450705e935178cbb7a9ae2df4fb98a78b301bbf3
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 7e2e017..6beb0e0 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; }
 


More information about the Libreoffice-commits mailing list