summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ivan <alexnivan@yahoo.com>2013-08-02 18:05:09 +0300
committerAlex Ivan <alexnivan@yahoo.com>2013-08-02 18:05:09 +0300
commita6c71aa549e3b5a00f19c618624bafd9b7007334 (patch)
tree8cbde2b19f4ccd804de5333d0f2340e4bf3f99ef
parentee61450df68e7cc539720d95c7f470f7b56c4cda (diff)
Set coresponding parent to attribute set
Changing style on a table now also changes the parent of the attribute set of the format of each element. Change-Id: I6bdc69bfe385932690851a18a47901e77e57bbec
-rw-r--r--sw/inc/format.hxx1
-rw-r--r--sw/source/core/doc/swtblfmt.cxx29
2 files changed, 29 insertions, 1 deletions
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index bf565f4dde6e..7ee6d6c33af9 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -108,6 +108,7 @@ public:
/// For querying the attribute array.
inline const SwAttrSet& GetAttrSet() const { return aSet; }
+ inline SwAttrSet& GetAttrSet() { return aSet; }
/** Das Doc wird jetzt am SwAttrPool gesetzt. Dadurch hat man es immer
im Zugriff. */
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index c771894e7cd4..62aeace9b9c0 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -263,11 +263,15 @@ void SwTableFmt::RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable &table )
if( pSrcFmt )
{
pHardFmt->RegisterToFormat( *pSrcFmt );
+ pHardFmt->GetAttrSet().SetParent( &pSrcFmt->GetAttrSet() );
bRowSplit = pSrcFmt->GetRowSplit();
nRepeatHeading = pSrcFmt->GetRepeatHeading();
}
else
+ {
pTableStyle->Remove( pHardFmt );
+ pHardFmt->GetAttrSet().SetParent( NULL );
+ }
AssignLineParents( pSrcFmt, table );
@@ -307,9 +311,15 @@ void SwTableFmt::AssignLineParents( SwTableFmt* pSrcFmt, SwTable &rTable )
}
if( pFmt )
+ {
pLineFmt->RegisterToFormat( *pFmt );
+ pLineFmt->GetAttrSet().SetParent( &pFmt->GetAttrSet() );
+ }
else if( pLineFmt->GetRegisteredIn() )
+ {
((SwTableLineFmt*)pLineFmt->GetRegisteredIn())->Remove( pLineFmt );
+ pLineFmt->GetAttrSet().SetParent( NULL );
+ }
AssignBoxParents( pFmt, *rTable.GetTabLines()[ n ] );
}
@@ -336,10 +346,15 @@ void SwTableFmt::AssignBoxParents( SwTableLineFmt* pSrcLineFmt, SwTableLine &rLi
}
if( pFmt )
+ {
pBoxFmt->RegisterToFormat( *pFmt );
+ pBoxFmt->GetAttrSet().SetParent( &pFmt->GetAttrSet() );
+ }
else if( pBoxFmt->GetRegisteredIn() )
+ {
((SwTableBoxFmt*)pBoxFmt->GetRegisteredIn())->Remove( pBoxFmt );
-
+ pBoxFmt->GetAttrSet().SetParent( NULL );
+ }
if( rLine.GetTabBoxes()[ n ]->GetTabLines().size() )
AssignLineParents_Complex( pSrcLineFmt, pFmt, *rLine.GetTabBoxes()[ n ] );
@@ -354,9 +369,15 @@ void SwTableFmt::AssignLineParents_Complex( SwTableLineFmt* pSrcLineFmt, SwTable
SwTableLineFmt* pLineFmt = (SwTableLineFmt*)rBox.GetTabLines()[ n ]->GetFrmFmt();
if( pSrcLineFmt )
+ {
pLineFmt->RegisterToFormat( *pSrcLineFmt );
+ pLineFmt->GetAttrSet().SetParent( &pSrcLineFmt->GetAttrSet() );
+ }
else
+ {
((SwTableLineFmt*)pLineFmt->GetRegisteredIn())->Remove( pLineFmt );
+ pLineFmt->GetAttrSet().SetParent( NULL );
+ }
AssignBoxParents_Complex( pSrcLineFmt, pSrcBoxFmt, *rBox.GetTabLines()[ n ] );
}
@@ -370,9 +391,15 @@ void SwTableFmt::AssignBoxParents_Complex( SwTableLineFmt* pSrcLineFmt, SwTableB
SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rLine.GetTabBoxes()[ n ]->GetFrmFmt();
if( pSrcBoxFmt )
+ {
pBoxFmt->RegisterToFormat( *pSrcBoxFmt );
+ pBoxFmt->GetAttrSet().SetParent( &pSrcBoxFmt->GetAttrSet() );
+ }
else
+ {
((SwTableBoxFmt*)pBoxFmt->GetRegisteredIn())->Remove( pBoxFmt );
+ pBoxFmt->GetAttrSet().SetParent( NULL );
+ }
if( rLine.GetTabBoxes()[ n ]->GetTabLines().size() )
AssignLineParents_Complex( pSrcLineFmt, pSrcBoxFmt, *rLine.GetTabBoxes()[ n ] );