summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-07-07 20:33:40 +0200
committerZolnai Tamás <zolnaitamas2000@gmail.com>2013-07-26 07:16:39 +0200
commit7b776bc01911e7b3ff0044bf88cfed9bcd1d97d8 (patch)
tree03f53aa4409a8108b922177a936fbe14120b6ab0 /sw/source
parent9bb7349bdbcb00ce73c50d37ffe55476939751c1 (diff)
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
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/bastyp/init.cxx9
-rw-r--r--sw/source/core/doc/dbgoutsw.cxx1
-rw-r--r--sw/source/core/inc/swfntcch.hxx2
-rw-r--r--sw/source/core/inc/swfont.hxx23
-rw-r--r--sw/source/core/text/atrhndl.hxx2
-rw-r--r--sw/source/core/text/atrstck.cxx21
-rw-r--r--sw/source/core/txtnode/swfont.cxx100
-rw-r--r--sw/source/filter/html/css1atr.cxx2
-rw-r--r--sw/source/filter/html/htmlatr.cxx2
-rw-r--r--sw/source/ui/app/docst.cxx31
-rw-r--r--sw/source/ui/fmtui/tmpdlg.cxx1
-rw-r--r--sw/source/ui/shells/textsh1.cxx25
12 files changed, 199 insertions, 20 deletions
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 7d585b7a5764..103c73e4e895 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -288,7 +288,7 @@ SfxItemInfo aSlotTab[] =
{ SID_ATTR_CHAR_HIDDEN, SFX_ITEM_POOLABLE }, // RES_CHRATR_HIDDEN
{ SID_ATTR_CHAR_OVERLINE, SFX_ITEM_POOLABLE }, // RES_CHRATR_OVERLINE
{ 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_RSID
- { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_DUMMY1
+ { 0, SFX_ITEM_POOLABLE }, // RES_CHRATR_BOX
{ 0, 0 }, // RES_TXTATR_REFMARK
{ 0, 0 }, // RES_TXTATR_TOXMARK
@@ -497,9 +497,7 @@ void _InitCore()
aAttrTab[ RES_CHRATR_RELIEF - POOLATTR_BEGIN ] = new SvxCharReliefItem( RELIEF_NONE, RES_CHRATR_RELIEF );
aAttrTab[ RES_CHRATR_HIDDEN - POOLATTR_BEGIN ] = new SvxCharHiddenItem( sal_False, RES_CHRATR_HIDDEN );
aAttrTab[ RES_CHRATR_OVERLINE- POOLATTR_BEGIN ] = new SvxOverlineItem( UNDERLINE_NONE, RES_CHRATR_OVERLINE );
-
-// CharakterAttr - Dummies
- aAttrTab[ RES_CHRATR_DUMMY1 - POOLATTR_BEGIN ] = new SfxBoolItem( RES_CHRATR_DUMMY1 );
+ aAttrTab[ RES_CHRATR_BOX - POOLATTR_BEGIN ] = new SvxBoxItem( RES_CHRATR_BOX );
aAttrTab[ RES_TXTATR_AUTOFMT- POOLATTR_BEGIN ] = new SwFmtAutoFmt;
aAttrTab[ RES_TXTATR_INETFMT - POOLATTR_BEGIN ] = new SwFmtINetFmt( aEmptyStr, aEmptyStr );
@@ -695,7 +693,10 @@ void _InitCore()
SwAttrPool::pVersionMap5[ i-1 ] = i + 6;
// 6. version:
+ // RES_CHARATR_OVERLINE
// new character attribute for overlining plus 2 dummies
+ // 1. dummy -> RES_CHRATR_RSID
+ // 2. dummy -> RES_CHRATR_BOX
SwAttrPool::pVersionMap6 = new sal_uInt16[ 136 ];
for( i = 1; i <= 37; i++ )
SwAttrPool::pVersionMap6[ i-1 ] = i;
diff --git a/sw/source/core/doc/dbgoutsw.cxx b/sw/source/core/doc/dbgoutsw.cxx
index efd10b7d5bdc..4dd024af3da2 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 e908c8473aa0..d7905818454c 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 a023dc28684a..e09a08a02f8e 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 a5a278206bc7..24c5f918325b 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 2747f26077fa..99fef3d13227 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 977b6d224ae3..5d40a102afe0 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 32fc32135eba..51fbc247044f 100644
--- a/sw/source/filter/html/css1atr.cxx
+++ b/sw/source/filter/html/css1atr.cxx
@@ -3641,7 +3641,7 @@ SwAttrFnTab aCSS1AttrFnTab = {
/* RES_CHRATR_HIDDEN */ OutCSS1_SvxHidden,
/* RES_CHRATR_OVERLINE */ OutCSS1_SvxOverline,
/* RES_CHRATR_RSID */ 0,
-/* RES_CHRATR_DUMMY1 */ 0,
+/* RES_CHRATR_BOX */ 0,
/* RES_TXTATR_REFMARK */ 0,
/* RES_TXTATR_TOXMARK */ 0,
diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx
index 4e3548ff2981..0879237e069b 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 92c06c40b36e..b5145bdbc28d 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 5def5e9f9ead..4dc1041380e3 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 65bf2a2d883e..80fe613a33be 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;