[Libreoffice-commits] core.git: Changes to 'refs/changes/01/3401/3'

2014-09-29 Thread Alex Ivan

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/01/3401/1'

2014-09-29 Thread Alex Ivan

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/00/3400/1'

2014-09-29 Thread Alex Ivan

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/47/5547/1'

2014-09-29 Thread Alex Ivan

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'refs/changes/01/3401/2'

2014-09-29 Thread Alex Ivan

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-09-15 Thread Alex Ivan
Rebased ref, commits from common ancestor:
commit a96a03be3d8ccc36bb43b3af0f1e569d8e7257b5
Author: Alex Ivan alexni...@yahoo.com
Date:   Sat Sep 7 19:38:48 2013 +0300

Correctly set the parent attribute set of the SwCntntNode

The text properties are set on the SwCntntNode, similar to how it
was done in the AutoFormat system. However, rather than setting
them directly on the node's attribute set, they are put into the
attribute set's parent.

There are some minor issues with updating the allignment of the
text within the cell.

Change-Id: I814b3b7d67744895deeb4e551a968f21e47cc77a

diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 7690cf8..9cebf4e 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -439,6 +439,7 @@ public:
 /// If bInParent is FALSE search for attribute only in this node.
 const SfxPoolItem GetAttr( sal_uInt16 nWhich, sal_Bool bInParent=sal_True 
) const;
 sal_Bool GetAttr( SfxItemSet rSet, sal_Bool bInParent=sal_True ) const;
+void SetAttrParent( const SfxItemSet* pParentSet );
 /// made virtual
 virtual sal_Bool SetAttr( const SfxPoolItem );
 virtual sal_Bool SetAttr( const SfxItemSet rSet );
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index ee5c3f0..072ef5a 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -367,6 +367,27 @@ void SwTableFmt::AssignBoxParents( SwTableLineFmt* 
pSrcLineFmt, SwTableLine rLi
 
 if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
 AssignLineParents_Complex( pSrcLineFmt, pFmt, 
*rLine.GetTabBoxes()[ n ] );
+else
+{
+SfxItemSet* pCharSet = NULL;
+if( pFmt )
+{
+pCharSet = new SfxItemSet( pBoxFmt-GetDoc()-GetAttrPool(),
+ RES_CHRATR_BEGIN, RES_PARATR_LIST_END - 1 );
+pCharSet-Put( pFmt-GetAttrSet() );
+}
+
+sal_uLong nSttNd = rLine.GetTabBoxes()[ n ]-GetSttIdx() + 1;
+sal_uLong nEndNd = rLine.GetTabBoxes()[ n 
]-GetSttNd()-EndOfSectionIndex();
+for( ; nSttNd  nEndNd; ++nSttNd )
+{
+SwCntntNode* pNd = pBoxFmt-GetDoc()-GetNodes()[ nSttNd 
]-GetCntntNode();
+if( pNd )
+{
+pNd-SetAttrParent( pCharSet );
+}
+}
+}
 
 ((SwModify*)pBoxFmt)-CheckCaching( RES_BOX );
 }
@@ -416,6 +437,27 @@ void SwTableFmt::AssignBoxParents_Complex( SwTableLineFmt* 
pSrcLineFmt, SwTableB
 
 if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
 AssignLineParents_Complex( pSrcLineFmt, pSrcBoxFmt, 
*rLine.GetTabBoxes()[ n ] );
+else
+{
+SfxItemSet* pCharSet = NULL;
+if( pSrcBoxFmt )
+{
+pCharSet = new SfxItemSet( pBoxFmt-GetDoc()-GetAttrPool(),
+ RES_CHRATR_BEGIN, RES_PARATR_LIST_END - 1 );
+pCharSet-Put( pSrcBoxFmt-GetAttrSet() );
+}
+
+sal_uLong nSttNd = rLine.GetTabBoxes()[ n ]-GetSttIdx() + 1;
+sal_uLong nEndNd = rLine.GetTabBoxes()[ n 
]-GetSttNd()-EndOfSectionIndex();
+for( ; nSttNd  nEndNd; ++nSttNd )
+{
+SwCntntNode* pNd = pBoxFmt-GetDoc()-GetNodes()[ nSttNd 
]-GetCntntNode();
+if( pNd )
+{
+pNd-SetAttrParent( pCharSet );
+}
+}
+}
 
 ((SwModify*)pBoxFmt)-CheckCaching( RES_BOX );
 }
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 90f371c..b4ebf6c 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -130,6 +130,22 @@ void SetParent( boost::shared_ptrconst SfxItemSet 
mrpAttrSet,
 }
 }
 
+void SetParent( boost::shared_ptrconst SfxItemSet mrpAttrSet,
+const SwCntntNode rNode,
+const SfxItemSet* pParentSet )
+{
+const SwAttrSet* pAttrSet = static_castconst 
SwAttrSet*(mrpAttrSet.get());
+OSL_ENSURE( pAttrSet, no SwAttrSet );
+
+if ( pParentSet != pAttrSet-GetParent() )
+{
+SwAttrSet aNewSet( *pAttrSet );
+aNewSet.SetParent( pParentSet );
+
+GetNewAutoStyle( mrpAttrSet, rNode, aNewSet );
+}
+}
+
 const SfxPoolItem* Put( boost::shared_ptrconst SfxItemSet mrpAttrSet,
 const SwCntntNode rNode,
 const SfxPoolItem rAttr )
@@ -1569,6 +1585,13 @@ sal_uInt16 SwCntntNode::ResetAllAttr()
 return aNew.Count();
 }
 
+void SwCntntNode::SetAttrParent( const SfxItemSet* pParentSet )
+{
+if( !GetpSwAttrSet() )
+NewAttrSet( GetDoc()-GetAttrPool() );
+
+AttrSetHandleHelper::SetParent( mpAttrSet, *this, pParentSet );
+}
 
 sal_Bool SwCntntNode::GetAttr( SfxItemSet rSet, sal_Bool bInParent ) const

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 3 commits - sw/inc sw/source

2013-09-15 Thread Alex Ivan
Rebased ref, commits from common ancestor:
commit b3781d43adbc0c9701af80d393c302c9c2252ba2
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Sep 12 16:19:51 2013 +0300

Remove obsolete UpdateTo/FromSet methods

These should have been removed some time ago, since they
were not used any more. Seems they somehow escaped.

Change-Id: I958de698f96a6c48e4cb41dc5226f96134d2886b

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index a4a330a..05de618 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -127,12 +127,6 @@ public:
 void SetName( const String rNew ) { m_pTableStyle-SetName( rNew ); 
nStrResId = USHRT_MAX; }
 const String GetName() const { return m_pTableStyle-GetName(); }
 
-enum UpdateFlags { UPDATE_CHAR = 1, UPDATE_BOX = 2, UPDATE_ALL = 3 };
-void UpdateFromSet( sal_uInt8 nPos, const SfxItemSet rSet,
-UpdateFlags eFlags, SvNumberFormatter* );
-void UpdateToSet( sal_uInt8 nPos, SfxItemSet rSet, UpdateFlags eFlags,
-SvNumberFormatter* ) const ;
-
 void RestoreTableProperties(SwTable table) const;
 void StoreTableProperties(const SwTable table);
 
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 426f0e6..2ff9b38 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -584,158 +584,6 @@ SwTableBoxFmt* SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos 
) const
 return m_pTableStyle-GetBoxFmt( nPos );
 }
 
-
-void SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
-const SfxItemSet rSet,
-UpdateFlags eFlags,
-SvNumberFormatter* pNFmtr)
-{
-OSL_ENSURE( nPos  16, wrong area );
-
-SwTableBoxFmt* pFmt = GetBoxFmt( nPos );
-
-if( UPDATE_CHAR  eFlags )
-{
-pFmt-SetFont( (SvxFontItem)rSet.Get( RES_CHRATR_FONT ) );
-pFmt-SetHeight( (SvxFontHeightItem)rSet.Get( RES_CHRATR_FONTSIZE ) );
-pFmt-SetWeight( (SvxWeightItem)rSet.Get( RES_CHRATR_WEIGHT ) );
-pFmt-SetPosture( (SvxPostureItem)rSet.Get( RES_CHRATR_POSTURE ) );
-pFmt-SetCJKFont( (SvxFontItem)rSet.Get( RES_CHRATR_CJK_FONT ) );
-pFmt-SetCJKHeight( (SvxFontHeightItem)rSet.Get( 
RES_CHRATR_CJK_FONTSIZE ) );
-pFmt-SetCJKWeight( (SvxWeightItem)rSet.Get( RES_CHRATR_CJK_WEIGHT ) 
);
-pFmt-SetCJKPosture( (SvxPostureItem)rSet.Get( RES_CHRATR_CJK_POSTURE 
) );
-pFmt-SetCTLFont( (SvxFontItem)rSet.Get( RES_CHRATR_CTL_FONT ) );
-pFmt-SetCTLHeight( (SvxFontHeightItem)rSet.Get( 
RES_CHRATR_CTL_FONTSIZE ) );
-pFmt-SetCTLWeight( (SvxWeightItem)rSet.Get( RES_CHRATR_CTL_WEIGHT ) 
);
-pFmt-SetCTLPosture( (SvxPostureItem)rSet.Get( RES_CHRATR_CTL_POSTURE 
) );
-pFmt-SetUnderline( (SvxUnderlineItem)rSet.Get( RES_CHRATR_UNDERLINE 
) );
-pFmt-SetOverline( (SvxOverlineItem)rSet.Get( RES_CHRATR_OVERLINE ) );
-pFmt-SetCrossedOut( (SvxCrossedOutItem)rSet.Get( 
RES_CHRATR_CROSSEDOUT ) );
-pFmt-SetContour( (SvxContourItem)rSet.Get( RES_CHRATR_CONTOUR ) );
-pFmt-SetShadowed( (SvxShadowedItem)rSet.Get( RES_CHRATR_SHADOWED ) );
-pFmt-SetColor( (SvxColorItem)rSet.Get( RES_CHRATR_COLOR ) );
-pFmt-SetAdjust( (SvxAdjustItem)rSet.Get( RES_PARATR_ADJUST ) );
-}
-if( UPDATE_BOX  eFlags )
-{
-pFmt-SetBox( (SvxBoxItem)rSet.Get( RES_BOX ) );
-// FIXME - add attribute IDs for the diagonal line items
-//pFmt-SetTLBR( (SvxLineItem)rSet.Get( RES_... ) );
-//pFmt-SetBLTR( (SvxLineItem)rSet.Get( RES_... ) );
-pFmt-SetBackground( (SvxBrushItem)rSet.Get( RES_BACKGROUND ) );
-pFmt-SetTextOrientation(static_castconst 
SvxFrameDirectionItem(rSet.Get(RES_FRAMEDIR)));
-pFmt-SetVerticalAlignment(static_castconst 
SwFmtVertOrient(rSet.Get(RES_VERT_ORIENT)));
-
-const SwTblBoxNumFormat* pNumFmtItem;
-const SvNumberformat* pNumFormat = 0;
-if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, sal_True,
-(const SfxPoolItem**)pNumFmtItem )  pNFmtr 
-0 != (pNumFormat = pNFmtr-GetEntry( pNumFmtItem-GetValue() )) )
-pFmt-SetValueFormat( 
((SvNumberformat*)pNumFormat)-GetFormatstring(),
-pNumFormat-GetLanguage(),
-::GetAppLanguage());
-else
-{
-// default
-pFmt-SetValueFormat( aEmptyStr, LANGUAGE_SYSTEM,
-  ::GetAppLanguage() );
-}
-}
-
-// we cannot handle the rest, that's specific to StarCalc
-}
-
-
-void SwTableAutoFmt::UpdateToSet(sal_uInt8 nPos, SfxItemSet rSet,
- UpdateFlags eFlags, SvNumberFormatter* 
pNFmtr) const
-{
-const SwTableBoxFmt rChg = *GetBoxFmt( nPos );
-
-if( UPDATE_CHAR  eFlags )
-{
-if( IsFont() )
-{
-rSet.Put

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 3 commits - sw/inc sw/source

2013-09-12 Thread Alex Ivan
Rebased ref, commits from common ancestor:
commit b3781d43adbc0c9701af80d393c302c9c2252ba2
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Sep 12 16:19:51 2013 +0300

Remove obsolete UpdateTo/FromSet methods

These should have been removed some time ago, since they
were not used any more. Seems they somehow escaped.

Change-Id: I958de698f96a6c48e4cb41dc5226f96134d2886b

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index a4a330a..05de618 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -127,12 +127,6 @@ public:
 void SetName( const String rNew ) { m_pTableStyle-SetName( rNew ); 
nStrResId = USHRT_MAX; }
 const String GetName() const { return m_pTableStyle-GetName(); }
 
-enum UpdateFlags { UPDATE_CHAR = 1, UPDATE_BOX = 2, UPDATE_ALL = 3 };
-void UpdateFromSet( sal_uInt8 nPos, const SfxItemSet rSet,
-UpdateFlags eFlags, SvNumberFormatter* );
-void UpdateToSet( sal_uInt8 nPos, SfxItemSet rSet, UpdateFlags eFlags,
-SvNumberFormatter* ) const ;
-
 void RestoreTableProperties(SwTable table) const;
 void StoreTableProperties(const SwTable table);
 
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 426f0e6..2ff9b38 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -584,158 +584,6 @@ SwTableBoxFmt* SwTableAutoFmt::GetBoxFmt( sal_uInt8 nPos 
) const
 return m_pTableStyle-GetBoxFmt( nPos );
 }
 
-
-void SwTableAutoFmt::UpdateFromSet( sal_uInt8 nPos,
-const SfxItemSet rSet,
-UpdateFlags eFlags,
-SvNumberFormatter* pNFmtr)
-{
-OSL_ENSURE( nPos  16, wrong area );
-
-SwTableBoxFmt* pFmt = GetBoxFmt( nPos );
-
-if( UPDATE_CHAR  eFlags )
-{
-pFmt-SetFont( (SvxFontItem)rSet.Get( RES_CHRATR_FONT ) );
-pFmt-SetHeight( (SvxFontHeightItem)rSet.Get( RES_CHRATR_FONTSIZE ) );
-pFmt-SetWeight( (SvxWeightItem)rSet.Get( RES_CHRATR_WEIGHT ) );
-pFmt-SetPosture( (SvxPostureItem)rSet.Get( RES_CHRATR_POSTURE ) );
-pFmt-SetCJKFont( (SvxFontItem)rSet.Get( RES_CHRATR_CJK_FONT ) );
-pFmt-SetCJKHeight( (SvxFontHeightItem)rSet.Get( 
RES_CHRATR_CJK_FONTSIZE ) );
-pFmt-SetCJKWeight( (SvxWeightItem)rSet.Get( RES_CHRATR_CJK_WEIGHT ) 
);
-pFmt-SetCJKPosture( (SvxPostureItem)rSet.Get( RES_CHRATR_CJK_POSTURE 
) );
-pFmt-SetCTLFont( (SvxFontItem)rSet.Get( RES_CHRATR_CTL_FONT ) );
-pFmt-SetCTLHeight( (SvxFontHeightItem)rSet.Get( 
RES_CHRATR_CTL_FONTSIZE ) );
-pFmt-SetCTLWeight( (SvxWeightItem)rSet.Get( RES_CHRATR_CTL_WEIGHT ) 
);
-pFmt-SetCTLPosture( (SvxPostureItem)rSet.Get( RES_CHRATR_CTL_POSTURE 
) );
-pFmt-SetUnderline( (SvxUnderlineItem)rSet.Get( RES_CHRATR_UNDERLINE 
) );
-pFmt-SetOverline( (SvxOverlineItem)rSet.Get( RES_CHRATR_OVERLINE ) );
-pFmt-SetCrossedOut( (SvxCrossedOutItem)rSet.Get( 
RES_CHRATR_CROSSEDOUT ) );
-pFmt-SetContour( (SvxContourItem)rSet.Get( RES_CHRATR_CONTOUR ) );
-pFmt-SetShadowed( (SvxShadowedItem)rSet.Get( RES_CHRATR_SHADOWED ) );
-pFmt-SetColor( (SvxColorItem)rSet.Get( RES_CHRATR_COLOR ) );
-pFmt-SetAdjust( (SvxAdjustItem)rSet.Get( RES_PARATR_ADJUST ) );
-}
-if( UPDATE_BOX  eFlags )
-{
-pFmt-SetBox( (SvxBoxItem)rSet.Get( RES_BOX ) );
-// FIXME - add attribute IDs for the diagonal line items
-//pFmt-SetTLBR( (SvxLineItem)rSet.Get( RES_... ) );
-//pFmt-SetBLTR( (SvxLineItem)rSet.Get( RES_... ) );
-pFmt-SetBackground( (SvxBrushItem)rSet.Get( RES_BACKGROUND ) );
-pFmt-SetTextOrientation(static_castconst 
SvxFrameDirectionItem(rSet.Get(RES_FRAMEDIR)));
-pFmt-SetVerticalAlignment(static_castconst 
SwFmtVertOrient(rSet.Get(RES_VERT_ORIENT)));
-
-const SwTblBoxNumFormat* pNumFmtItem;
-const SvNumberformat* pNumFormat = 0;
-if( SFX_ITEM_SET == rSet.GetItemState( RES_BOXATR_FORMAT, sal_True,
-(const SfxPoolItem**)pNumFmtItem )  pNFmtr 
-0 != (pNumFormat = pNFmtr-GetEntry( pNumFmtItem-GetValue() )) )
-pFmt-SetValueFormat( 
((SvNumberformat*)pNumFormat)-GetFormatstring(),
-pNumFormat-GetLanguage(),
-::GetAppLanguage());
-else
-{
-// default
-pFmt-SetValueFormat( aEmptyStr, LANGUAGE_SYSTEM,
-  ::GetAppLanguage() );
-}
-}
-
-// we cannot handle the rest, that's specific to StarCalc
-}
-
-
-void SwTableAutoFmt::UpdateToSet(sal_uInt8 nPos, SfxItemSet rSet,
- UpdateFlags eFlags, SvNumberFormatter* 
pNFmtr) const
-{
-const SwTableBoxFmt rChg = *GetBoxFmt( nPos );
-
-if( UPDATE_CHAR  eFlags )
-{
-if( IsFont() )
-{
-rSet.Put

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/inc sw/source

2013-09-07 Thread Alex Ivan
 sw/inc/node.hxx |1 
 sw/source/core/doc/swtblfmt.cxx |   42 
 sw/source/core/docnode/node.cxx |   23 +
 sw/source/core/text/atrstck.cxx |   20 ---
 4 files changed, 71 insertions(+), 15 deletions(-)

New commits:
commit a96a03be3d8ccc36bb43b3af0f1e569d8e7257b5
Author: Alex Ivan alexni...@yahoo.com
Date:   Sat Sep 7 19:38:48 2013 +0300

Correctly set the parent attribute set of the SwCntntNode

The text properties are set on the SwCntntNode, similar to how it
was done in the AutoFormat system. However, rather than setting
them directly on the node's attribute set, they are put into the
attribute set's parent.

There are some minor issues with updating the allignment of the
text within the cell.

Change-Id: I814b3b7d67744895deeb4e551a968f21e47cc77a

diff --git a/sw/inc/node.hxx b/sw/inc/node.hxx
index 7690cf8..9cebf4e 100644
--- a/sw/inc/node.hxx
+++ b/sw/inc/node.hxx
@@ -439,6 +439,7 @@ public:
 /// If bInParent is FALSE search for attribute only in this node.
 const SfxPoolItem GetAttr( sal_uInt16 nWhich, sal_Bool bInParent=sal_True 
) const;
 sal_Bool GetAttr( SfxItemSet rSet, sal_Bool bInParent=sal_True ) const;
+void SetAttrParent( const SfxItemSet* pParentSet );
 /// made virtual
 virtual sal_Bool SetAttr( const SfxPoolItem );
 virtual sal_Bool SetAttr( const SfxItemSet rSet );
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index ee5c3f0..072ef5a 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -367,6 +367,27 @@ void SwTableFmt::AssignBoxParents( SwTableLineFmt* 
pSrcLineFmt, SwTableLine rLi
 
 if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
 AssignLineParents_Complex( pSrcLineFmt, pFmt, 
*rLine.GetTabBoxes()[ n ] );
+else
+{
+SfxItemSet* pCharSet = NULL;
+if( pFmt )
+{
+pCharSet = new SfxItemSet( pBoxFmt-GetDoc()-GetAttrPool(),
+ RES_CHRATR_BEGIN, RES_PARATR_LIST_END - 1 );
+pCharSet-Put( pFmt-GetAttrSet() );
+}
+
+sal_uLong nSttNd = rLine.GetTabBoxes()[ n ]-GetSttIdx() + 1;
+sal_uLong nEndNd = rLine.GetTabBoxes()[ n 
]-GetSttNd()-EndOfSectionIndex();
+for( ; nSttNd  nEndNd; ++nSttNd )
+{
+SwCntntNode* pNd = pBoxFmt-GetDoc()-GetNodes()[ nSttNd 
]-GetCntntNode();
+if( pNd )
+{
+pNd-SetAttrParent( pCharSet );
+}
+}
+}
 
 ((SwModify*)pBoxFmt)-CheckCaching( RES_BOX );
 }
@@ -416,6 +437,27 @@ void SwTableFmt::AssignBoxParents_Complex( SwTableLineFmt* 
pSrcLineFmt, SwTableB
 
 if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
 AssignLineParents_Complex( pSrcLineFmt, pSrcBoxFmt, 
*rLine.GetTabBoxes()[ n ] );
+else
+{
+SfxItemSet* pCharSet = NULL;
+if( pSrcBoxFmt )
+{
+pCharSet = new SfxItemSet( pBoxFmt-GetDoc()-GetAttrPool(),
+ RES_CHRATR_BEGIN, RES_PARATR_LIST_END - 1 );
+pCharSet-Put( pSrcBoxFmt-GetAttrSet() );
+}
+
+sal_uLong nSttNd = rLine.GetTabBoxes()[ n ]-GetSttIdx() + 1;
+sal_uLong nEndNd = rLine.GetTabBoxes()[ n 
]-GetSttNd()-EndOfSectionIndex();
+for( ; nSttNd  nEndNd; ++nSttNd )
+{
+SwCntntNode* pNd = pBoxFmt-GetDoc()-GetNodes()[ nSttNd 
]-GetCntntNode();
+if( pNd )
+{
+pNd-SetAttrParent( pCharSet );
+}
+}
+}
 
 ((SwModify*)pBoxFmt)-CheckCaching( RES_BOX );
 }
diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index 90f371c..b4ebf6c 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -130,6 +130,22 @@ void SetParent( boost::shared_ptrconst SfxItemSet 
mrpAttrSet,
 }
 }
 
+void SetParent( boost::shared_ptrconst SfxItemSet mrpAttrSet,
+const SwCntntNode rNode,
+const SfxItemSet* pParentSet )
+{
+const SwAttrSet* pAttrSet = static_castconst 
SwAttrSet*(mrpAttrSet.get());
+OSL_ENSURE( pAttrSet, no SwAttrSet );
+
+if ( pParentSet != pAttrSet-GetParent() )
+{
+SwAttrSet aNewSet( *pAttrSet );
+aNewSet.SetParent( pParentSet );
+
+GetNewAutoStyle( mrpAttrSet, rNode, aNewSet );
+}
+}
+
 const SfxPoolItem* Put( boost::shared_ptrconst SfxItemSet mrpAttrSet,
 const SwCntntNode rNode,
 const SfxPoolItem rAttr )
@@ -1569,6 +1585,13 @@ sal_uInt16 SwCntntNode::ResetAllAttr()
 return aNew.Count();
 }
 
+void SwCntntNode::SetAttrParent( const SfxItemSet* pParentSet

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 8 commits - sw/inc sw/source

2013-08-29 Thread Alex Ivan
 sw/inc/doc.hxx|3 +++
 sw/source/core/doc/docnew.cxx |5 +
 sw/source/core/doc/swtblfmt.cxx   |3 +++
 sw/source/core/doc/tblafmt.cxx|9 +++--
 sw/source/core/doc/tblrwcl.cxx|8 +++-
 sw/source/core/docnode/ndcopy.cxx |9 -
 sw/source/core/docnode/ndtbl.cxx  |   14 ++
 sw/source/core/undo/untbl.cxx |   13 +++--
 sw/source/ui/table/tautofmt.cxx   |4 +---
 9 files changed, 55 insertions(+), 13 deletions(-)

New commits:
commit 452435c85c5fbe1e62ec81bc39deccb646a78bf6
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 29 19:02:57 2013 +0300

Reapply table style after merging tables

The undo part was inadvertedly already fixed since it used the
same mechanics as some of the previously fixed undo actions.

Change-Id: I75380513945a6b84fa8f18ab77c756b4e8c358c1

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 8133065..d67ca3a 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3390,6 +3390,9 @@ sal_Bool SwDoc::MergeTable( const SwPosition rPos, 
sal_Bool bWithPrev, sal_uInt
 if( !pDelTblNd )
 return sal_False;
 
+SwTableFmt* pStyle = 
(SwTableFmt*)pTblNd-GetTable().GetTableFmt()-GetRegisteredIn();
+SwTable rTable = (bWithPrev ? pDelTblNd : pTblNd)-GetTable();
+
 if( pTblNd-GetTable().ISA( SwDDETable ) ||
 pDelTblNd-GetTable().ISA( SwDDETable ))
 return sal_False;
@@ -3427,6 +3430,8 @@ sal_Bool SwDoc::MergeTable( const SwPosition rPos, 
sal_Bool bWithPrev, sal_uInt
 }
 if( bRet )
 {
+SwTableFmt::AssignFormatParents( pStyle, rTable );
+
 SetModified();
 SetFieldsDirty( true, NULL, 0 );
 }
commit 758c691d749b3e2770a4b7a14579e5bbfde5114a
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 29 18:15:44 2013 +0300

Reapply table style after spliting table and undo

Change-Id: I32fea8b4679809070a47368de65d57ce5df7ed9d

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index e6d5821..8133065 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3153,6 +3153,9 @@ sal_Bool SwDoc::SplitTable( const SwPosition rPos, 
sal_uInt16 eHdlnMode,
 // TL_CHART2: need to inform chart of probably changed cell names
 UpdateCharts( rTbl.GetFrmFmt()-GetName() );
 
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)rTbl.GetTableFmt()-GetRegisteredIn(), rTbl );
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)rTbl.GetTableFmt()-GetRegisteredIn(), pNew-GetTable() );
+
 SetFieldsDirty( true, NULL, 0 );
 
 return 0 != pNew;
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 661ed33..5fa3d2a 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2927,6 +2927,12 @@ void SwUndoSplitTbl::UndoImpl(::sw::UndoRedoContext  
rContext)
 pTblNd-GetTable().RestoreRowSpan( *mpSaveRowSpan );
 }
 ClearFEShellTabCols();
+
+pTblNd = rIdx.GetNode().FindTableNode();
+if( pTblNd )
+SwTableFmt::AssignFormatParents( (SwTableFmt*)pTblNd-GetTable().
+  GetTableFmt()-GetRegisteredIn(),
+  pTblNd-GetTable() );
 }
 
 void SwUndoSplitTbl::RedoImpl(::sw::UndoRedoContext  rContext)
commit 49d18eb95929b4d0fadfaa5ba553049922bd4fb4
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 29 15:26:02 2013 +0300

Reapply table styles after merging/spliting cells and corresponding undos

Change-Id: I0a0f1cd1ec05487230af568ab3350de04d98bfb6

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 0a09ccd..e6d5821 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -2112,6 +2112,8 @@ sal_Bool SwDoc::SplitTbl( const SwSelBoxes rBoxes, 
sal_Bool bVert, sal_uInt16 n
 delete pUndo;
 }
 
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)rTbl.GetTableFmt()-GetRegisteredIn(), rTbl );
+
 return bRet;
 }
 
@@ -2217,6 +2219,10 @@ sal_uInt16 SwDoc::MergeTbl( SwPaM rPam )
 ::ClearFEShellTabCols();
 SetRedlineMode_intern( eOld );
 }
+
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)rTable.GetTableFmt()-GetRegisteredIn(),
+ rTable );
+
 GetIDocumentUndoRedo().EndUndo( UNDO_TABLE_MERGE, NULL );
 return nRet;
 }
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index afba0c2..661ed33 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -2076,6 +2076,9 @@ CHECKTABLE(pTblNd-GetTable())
 
 CHECKTABLE(pTblNd-GetTable())
 ClearFEShellTabCols();
+
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)pTblNd-GetTable().GetTableFmt()-GetRegisteredIn(),
+ pTblNd-GetTable() );
 }
 
 void SwUndoTblMerge

[GSOC] Implementing Table Styles - Status update

2013-08-25 Thread Alex Ivan
Hello everybody,

Here's the progress I've made during the past couple of weeks:
- fixed undo after resizing the table causing loss of table style
- adapted inserting/deleting rows/columns and respective undos
operation so that the properties are correctly updated
- submitted a beginning of a fix for fdo#59048, which avoids the
crash but might cause a memory leak, so someone should take a
look at that [1]. Initially, I thought the bug was a regression I
introduced, and it took a while to figure out.
- tried some more to get the borders and text properties to update
properly, but have not had much luck
- had a go at applying the table style on a copy-pasted table, but
I might be doing it wrong.

Plans for this week:
- Getting the copy-pasting to work (currently, I seem to have
succeeded in applying the style to the table in the clipboard, not
on the one which is actually inserted in the document).
- Try to make the borders and text properties work, although
i'll probably leave this for last, since I've spent a considerable
amount of time on it and haven't got much done.
- Adapt merging of tables and cells and undos to take the table
styles into consideration.
- Take a look at how the filters work in order to start working
on them.

[1] http://gerrit.libreoffice.org/#/c/5547/
http://gerrit.libreoffice.org/#/c/5547/  

Cheers,
Alex



--
View this message in context: 
http://nabble.documentfoundation.org/GSOC-Implementing-Table-Styles-Status-update-tp4071572.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: Branch 'feature/table-style' - 6 commits - sw/source

2013-08-22 Thread Alex Ivan
 sw/source/core/doc/swtblfmt.cxx  |8 
 sw/source/core/doc/tblrwcl.cxx   |4 
 sw/source/core/docnode/ndtbl.cxx |   17 -
 sw/source/core/inc/UndoTable.hxx |1 -
 sw/source/core/undo/untbl.cxx|8 
 5 files changed, 28 insertions(+), 10 deletions(-)

New commits:
commit 17d00196dbcaa8a98f65f6b3c1c33e507ddbf210
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 22 19:14:40 2013 +0300

Proper undo for row/column insertion/deletion

Change-Id: If0de2939334ecf10d96e26d5a5c3d99dfa3deba2

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 9a89ab1..8181640 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1792,6 +1792,10 @@ void SwUndoTblNdsChg::UndoImpl(::sw::UndoRedoContext  
rContext)
 if( IsDelBox() )
 nSttNode = pTblNd-GetIndex();
 ClearFEShellTabCols();
+
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)pTblNd-GetTable().GetFrmFmt()-GetRegisteredIn(),
+ pTblNd-GetTable() );
+
 CHECK_TABLE( pTblNd-GetTable() )
 }
 
@@ -1904,6 +1908,10 @@ void SwUndoTblNdsChg::RedoImpl(::sw::UndoRedoContext  
rContext)
 ;
 }
 ClearFEShellTabCols();
+
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)pTblNd-GetTable().GetFrmFmt()-GetRegisteredIn(),
+ pTblNd-GetTable() );
+
 CHECK_TABLE( pTblNd-GetTable() )
 }
 
commit 609527032d6ebc6df15a7082a0bbed681f924a47
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 22 18:10:34 2013 +0300

Reapply table style after row/column deletion

Change-Id: I24c851a2d1674aec96ca7577dfc92302e226fe4e

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 896861f..0a09ccd 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -1986,6 +1986,10 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes rBoxes, 
bool bColumn )
 pTblNd-DelFrms();
 DeleteSection( pTblNd );
 }
+
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)rTable.GetFrmFmt()-GetRegisteredIn(),
+rTable );
+
 SetModified();
 SetFieldsDirty( true, NULL, 0 );
 return sal_True;
@@ -2017,6 +2021,9 @@ sal_Bool SwDoc::DeleteRowCol( const SwSelBoxes rBoxes, 
bool bColumn )
 bRet = rTable.DeleteSel( this, aSelBoxes, 0, pUndo, true, true );
 if (bRet)
 {
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)rTable.GetFrmFmt()-GetRegisteredIn(),
+rTable );
+
 SetModified();
 SetFieldsDirty( true, NULL, 0 );
 }
commit 23241bd4c6f9e7a7094ba962223bd57edbae813c
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 22 15:47:23 2013 +0300

Reapply table style after inserting rows

Change-Id: I56cc24f80a3812f9a04fcb639cc38eaa628fc95e

diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 8e0ee86..70560a7 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -664,6 +664,8 @@ bool SwTable::_InsertRow( SwDoc* pDoc, const SwSelBoxes 
rBoxes,
 pPCD-AddRowCols( *this, rBoxes, nCnt, bBehind );
 pDoc-UpdateCharts( GetFrmFmt()-GetName() );
 
+SwTableFmt::AssignFormatParents( 
(SwTableFmt*)GetFrmFmt()-GetRegisteredIn(), *this );
+
 return true;
 }
 
commit 80090c35ad14c860abd195f6ced5fc37270e8943
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 22 15:43:00 2013 +0300

Adjust format parent assigning

Modify format parent assigning mechanism so that the format
is claimed when assigning the parent, if it has other dependencies,
instead of attempting to have each element created with its own
Sw*Fmt on insertion.

Change-Id: I569b2a865d41fa6da57e0a0cb090a0fbccddb13c

diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 5e3d88d..823f073 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -299,7 +299,7 @@ void SwTableFmt::AssignLineParents( SwTableFmt* pSrcFmt, 
SwTable rTable )
 sal_uInt16 nLines = rTable.GetTabLines().size();
 for( sal_uInt16 n = 0; n  nLines; ++n )
 {
-SwTableLineFmt* pLineFmt = (SwTableLineFmt*)rTable.GetTabLines()[ n 
]-GetFrmFmt();
+SwTableLineFmt* pLineFmt = (SwTableLineFmt*)rTable.GetTabLines()[ n 
]-ClaimFrmFmt();
 SwTableLineFmt* pFmt = 0;
 
 if( pSrcFmt )
@@ -336,7 +336,7 @@ void SwTableFmt::AssignBoxParents( SwTableLineFmt* 
pSrcLineFmt, SwTableLine rLi
 sal_uInt16 nBoxes = rLine.GetTabBoxes().size();
 for( sal_uInt16 n = 0; n  nBoxes; ++n )
 {
-SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rLine.GetTabBoxes()[ n 
]-GetFrmFmt();
+SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rLine.GetTabBoxes()[ n 
]-ClaimFrmFmt();
 SwTableBoxFmt* pFmt = 0

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/source

2013-08-13 Thread Alex Ivan
 sw/source/core/doc/swtblfmt.cxx  |   10 ++
 sw/source/core/docnode/ndtbl.cxx |2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 3bbc021a8b091e4f50c9bd453fd11607a7cf45a9
Author: Alex Ivan alexni...@yahoo.com
Date:   Tue Aug 13 21:17:34 2013 +0300

Parent assigning cleanup

Another place where I had previously not modified to
the correct function.

Change-Id: I1a2d024fcacf9d1de6eb8f5c3cd2e70bcd1771a9

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 1a7ff43..36763c8 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -492,7 +492,7 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 }
 }
 
-SwTableFmt::AssignLineParents( pTableStyle, *pNdTbl );
+SwTableFmt::AssignFormatParents( pTableStyle, *pNdTbl );
 
 // Insert Frms
 GetNodes().GoNext( aNdIdx ); // Go to the next ContentNode
commit fe8c43a6c96f3697553cdc4664ed0defd4dacc83
Author: Alex Ivan alexni...@yahoo.com
Date:   Tue Aug 13 17:42:13 2013 +0300

Fix borders update with table style application

Change-Id: I9d794d96f3542bd3597ab38586df58edff62a16d

diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 965f3e8..5e3d88d 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -290,6 +290,8 @@ void SwTableFmt::AssignFormatParents( SwTableFmt* pSrcFmt, 
SwTable rTable )
 pLast-InvalidateAll();
 pLast-SetCompletePaint();
 }
+
+((SwModify*)pHardFmt)-CheckCaching( RES_BOX );
 }
 
 void SwTableFmt::AssignLineParents( SwTableFmt* pSrcFmt, SwTable rTable )
@@ -324,6 +326,8 @@ void SwTableFmt::AssignLineParents( SwTableFmt* pSrcFmt, 
SwTable rTable )
 }
 
 AssignBoxParents( pFmt, *rTable.GetTabLines()[ n ] );
+
+((SwModify*)pLineFmt)-CheckCaching( RES_BOX );
 }
 }
 
@@ -360,6 +364,8 @@ void SwTableFmt::AssignBoxParents( SwTableLineFmt* 
pSrcLineFmt, SwTableLine rLi
 
 if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
 AssignLineParents_Complex( pSrcLineFmt, pFmt, 
*rLine.GetTabBoxes()[ n ] );
+
+((SwModify*)pBoxFmt)-CheckCaching( RES_BOX );
 }
 }
 
@@ -382,6 +388,8 @@ void SwTableFmt::AssignLineParents_Complex( SwTableLineFmt* 
pSrcLineFmt, SwTable
 }
 
 AssignBoxParents_Complex( pSrcLineFmt, pSrcBoxFmt, 
*rBox.GetTabLines()[ n ] );
+
+((SwModify*)pLineFmt)-CheckCaching( RES_BOX );
 }
 }
 
@@ -405,6 +413,8 @@ void SwTableFmt::AssignBoxParents_Complex( SwTableLineFmt* 
pSrcLineFmt, SwTableB
 
 if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
 AssignLineParents_Complex( pSrcLineFmt, pSrcBoxFmt, 
*rLine.GetTabBoxes()[ n ] );
+
+((SwModify*)pBoxFmt)-CheckCaching( RES_BOX );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/source

2013-08-12 Thread Alex Ivan
 sw/source/core/doc/swtblfmt.cxx  |2 +-
 sw/source/core/doc/tblafmt.cxx   |4 ++--
 sw/source/core/inc/UndoTable.hxx |3 ++-
 sw/source/core/undo/untbl.cxx|   38 ++
 4 files changed, 39 insertions(+), 8 deletions(-)

New commits:
commit bef91df4dc67cb0af0f57c323f1c8339dbf5a329
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Aug 12 20:59:41 2013 +0300

Fix undo resize table causing lose of table style

_SaveTable class now memorizes the name of the table style
applied to the table and it is reapplied after undoing.

Not the most elegant solution, but given how the _Save* classes
currently store data on the table, this solution avoids modifying
too much and possibly breaking other things.

Change-Id: I5c2afb0cdd5eb447f548249e9afa1dd6d648e3a9

diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 6aca5e7..9a89ab1 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -116,6 +116,7 @@ class _SaveTable
 SfxItemSet aTblSet;
 _SaveLine* pLine;
 const SwTable* pSwTable;
+String sSaveFmtName;
 SfxItemSets aSets;
 SwFrmFmts aFrmFmts;
 sal_uInt16 nLineCount;
@@ -874,6 +875,11 @@ _SaveTable::_SaveTable( const SwTable rTbl, sal_uInt16 
nLnCnt, bool bSaveFml )
 bModifyBox = false;
 bNewModel = rTbl.IsNewModel();
 aTblSet.Put( rTbl.GetFrmFmt()-GetAttrSet() );
+
+SwTableFmt* pSaveFmt = (SwTableFmt*)rTbl.GetTableFmt()-GetRegisteredIn();
+if( pSaveFmt )
+sSaveFmtName = pSaveFmt-GetName();
+
 pLine = new _SaveLine( 0, *rTbl.GetTabLines()[ 0 ], *this );
 
 _SaveLine* pLn = pLine;
@@ -931,6 +937,7 @@ void _SaveTable::RestoreAttr( SwTable rTbl, bool bMdfyBox )
 
 // first, get back attributes of TableFrmFormat
 SwFrmFmt* pFmt = rTbl.GetFrmFmt();
+SwDoc* pDoc = pFmt-GetDoc();
 SfxItemSet rFmtSet  = (SfxItemSet)pFmt-GetAttrSet();
 rFmtSet.ClearItem();
 rFmtSet.Put( aTblSet );
@@ -971,6 +978,14 @@ void _SaveTable::RestoreAttr( SwTable rTbl, bool bMdfyBox 
)
 pLn-RestoreAttr( *rTbl.GetTabLines()[ n ], *this );
 }
 
+if( !sSaveFmtName.Len() )
+SwTableFmt::RestoreTableProperties( NULL, rTbl );
+else
+{
+SwTableFmt* pStyle = pDoc-FindTblFmtByName( sSaveFmtName, sal_True );
+SwTableFmt::RestoreTableProperties( pStyle, rTbl );
+}
+
 aFrmFmts.clear();
 bModifyBox = false;
 }
commit 6538a97573635fe9d8cfa595963d7d18394a25c6
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Aug 12 20:02:17 2013 +0300

Store table style in Undo by name

Undo object no longer stores a pointer to the
style, but rather the name of the respective table style.

Change-Id: I1f6f196569d33353a9075489d136df9e5075d36b

diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 276c37a..965f3e8 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -250,7 +250,7 @@ void SwTableFmt::RestoreTableProperties( SwTableFmt* 
pSrcFmt, SwTable rTable )
 bRowSplit = pSrcFmt-GetRowSplit();
 nRepeatHeading = pSrcFmt-GetRepeatHeading();
 }
-else
+else if( pTableStyle )
 pTableStyle-Remove( pHardFmt );
 
 AssignFormatParents( pSrcFmt, rTable );
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 8881553..976aa0a 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -846,7 +846,7 @@ SwTableAutoFmt* SwTableAutoFmt::Load( SvStream rStream, 
const SwAfVersions rVe
 // ideal, the table styles are created with the document
 SwTableFmt* pStyle = pDoc-FindTblFmtByName(aName);
 if ( !pStyle )
-pStyle = pDoc-MakeTblFrmFmt(aName, NULL);
+pStyle = pDoc-MakeTblFrmFmt( aName, pDoc-GetDfltFrmFmt() );
 pRet = new SwTableAutoFmt( aName, pStyle );
 
 pRet-nStrResId = nStrResId;
@@ -967,7 +967,7 @@ SwTableAutoFmtTbl::SwTableAutoFmtTbl(SwDoc* pDoc)
 sNm = SwStyleNameMapper::GetUIName( RES_POOLCOLL_STANDARD, sNm );
 SwTableFmt* pStyle = pDoc-FindTblFmtByName(sNm);
 if ( !pStyle )
-pStyle = pDoc-MakeTblFrmFmt(sNm, NULL);
+pStyle = pDoc-MakeTblFrmFmt( sNm, pDoc-GetDfltFrmFmt() );
 SwTableAutoFmt* pNewTableAutoFmt = new SwTableAutoFmt( sNm, pStyle );
 
 SwTableBoxFmt* pNewBoxFmt = pDoc-MakeTableBoxFmt();
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 09bed01..4170c21 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -147,7 +147,8 @@ class SwUndoTblNumFmt;
 class SwUndoTblAutoFmt : public SwUndo
 {
 sal_uLong nSttNode;
-SwTableFmt* pSaveFmt;
+String sSaveFmtName;
+//String sEmptyStr;
 sal_uInt16 m_nRepeatHeading;
 
 void UndoRedo(bool const bUndo, ::sw::UndoRedoContext  rContext);
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 4 commits - sw/inc sw/source

2013-08-09 Thread Alex Ivan
 sw/inc/swtblfmt.hxx  |2 ++
 sw/source/core/doc/swtblfmt.cxx  |8 
 sw/source/core/docnode/ndtbl.cxx |   29 +++--
 sw/source/core/inc/UndoTable.hxx |4 +---
 sw/source/core/undo/untbl.cxx|   11 ++-
 5 files changed, 28 insertions(+), 26 deletions(-)

New commits:
commit 8d9905db69b2693cde5e80e53ccab521f4b8040f
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Aug 9 17:10:10 2013 +0300

Fix undo for applying table style

Undo now works for applying a new table style. There is an issue
where other undo commands i.e. resizing a cell will undo the
table style, probably due to not setting the parents correctly.

Change-Id: Ia7955e6303be57ec9ea10bd61a355a18c420

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 4dd25c0..1a7ff43 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -3556,7 +3556,7 @@ sal_Bool SwDoc::SetTableAutoFmt( const SwSelBoxes 
rBoxes, const SwTableAutoFmt
 bool const bUndo(GetIDocumentUndoRedo().DoesUndo());
 if (bUndo)
 {
-pUndo = new SwUndoTblAutoFmt( *pTblNd, rNew );
+pUndo = new SwUndoTblAutoFmt( *pTblNd );
 GetIDocumentUndoRedo().AppendUndo(pUndo);
 GetIDocumentUndoRedo().DoUndo(false);
 }
diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index 37f5c41..09bed01 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -153,9 +153,7 @@ class SwUndoTblAutoFmt : public SwUndo
 void UndoRedo(bool const bUndo, ::sw::UndoRedoContext  rContext);
 
 public:
-SwUndoTblAutoFmt( const SwTableNode rTblNd, const SwTableAutoFmt );
-
-virtual ~SwUndoTblAutoFmt();
+SwUndoTblAutoFmt( const SwTableNode rTblNd );
 
 virtual void UndoImpl( ::sw::UndoRedoContext  );
 virtual void RedoImpl( ::sw::UndoRedoContext  );
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index 8c30a50..5ddb001 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1406,18 +1406,12 @@ void SwUndoAttrTbl::RedoImpl(::sw::UndoRedoContext  
rContext)
 }
 
 // UndoObject for AutoFormat on Table
-SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode rTblNd,
-const SwTableAutoFmt rAFmt )
+SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode rTblNd )
 : SwUndo( UNDO_TABLE_AUTOFMT ),
 nSttNode( rTblNd.GetIndex() ),
 m_nRepeatHeading(rTblNd.GetTable().GetRowsToRepeat())
 {
-pSaveFmt = new SwTableFmt( *rAFmt.GetTableStyle() );
-}
-
-SwUndoTblAutoFmt::~SwUndoTblAutoFmt()
-{
-delete pSaveFmt;
+pSaveFmt = (SwTableFmt*)rTblNd.GetTable().GetTableFmt()-GetRegisteredIn();
 }
 
 void
@@ -1434,7 +1428,6 @@ SwUndoTblAutoFmt::UndoRedo(bool const bUndo, 
::sw::UndoRedoContext  rContext)
 table.SetRowsToRepeat( m_nRepeatHeading );
 
 SwTableFmt::RestoreTableProperties( pSaveFmt, table );
-delete pSaveFmt;
 pSaveFmt = pOrig;
 }
 
commit 085921a92a9255b1419687c2c0efb08145729cf3
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Aug 9 17:05:19 2013 +0300

Fix borders on Text to table method

Default borders no longer mask the ones from the table style if
borders checkbox is checked in Text to Table dialog and an
autoformat is selected. In other words, it bypasses the state of
said checkbox. May instead want to default its state to unchecked
in order to be clearer to the user.

Also, there is a strange crash on the undo operation. (Somehow,
a pointer ends up pointing to 0x99..9)

Change-Id: I4fe5ebec5ea2470d6b27869f043b5110d5fc0c3a

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index c6adade..4dd25c0 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -103,7 +103,7 @@ extern void ClearFEShellTabCols();
 // Located in gctable.cxx
 extern sal_Bool sw_GC_Line_Border( const SwTableLine* , void* pPara );
 
-static void lcl_SetDfltBoxAttr( SwFrmFmt rFmt, sal_uInt8 nId )
+static void lcl_SetDfltBoxAttr( SwFrmFmt rFmt, sal_uInt8 nId, sal_Bool 
bSetBorders )
 {
 sal_Bool bTop = false, bBottom = false, bLeft = false, bRight = false;
 switch ( nId )
@@ -131,7 +131,8 @@ static void lcl_SetDfltBoxAttr( SwFrmFmt rFmt, sal_uInt8 
nId )
 aBox.SetLine( aLine, BOX_LINE_LEFT );
 if ( bRight )
 aBox.SetLine( aLine, BOX_LINE_RIGHT );
-rFmt.SetFmtAttr( aBox );
+if ( bSetBorders )
+rFmt.SetFmtAttr( aBox );
 }
 
 typedef std::mapSwFrmFmt *, SwTableBoxFmt * DfltBoxAttrMap_t;
@@ -139,7 +140,7 @@ typedef std::vectorDfltBoxAttrMap_t * DfltBoxAttrList_t;
 
 static void
 lcl_SetDfltBoxAttr(SwTableBox rBox, DfltBoxAttrList_t  rBoxFmtArr,
-sal_uInt8 const nId, SwTableAutoFmt const*const pAutoFmt = 0)
+sal_uInt8 const nId, sal_Bool bSetBorders )
 {
 DfltBoxAttrMap_t * pMap

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 3 commits - sw/inc sw/source

2013-08-05 Thread Alex Ivan
 sw/inc/swtblfmt.hxx  |9 +
 sw/source/core/doc/swtblfmt.cxx  |   30 --
 sw/source/core/docnode/ndtbl.cxx |9 +++--
 3 files changed, 28 insertions(+), 20 deletions(-)

New commits:
commit b17dad3335476d9631d0f504876810efd7d929e7
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Aug 5 14:15:04 2013 +0300

Fix column width in TextToTable

Change-Id: Ibe6321e5c79a7b1081087b0ae7d24a22ca676c4c

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 1cf3585..614800d 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -729,17 +729,14 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions rInsTblOpts,
 for( sal_uInt16 i = 0; i  nCols; ++i )
 {
 SwTableBox* pBox = rBoxes[ i ];
-bool bChgSz = false;
 
 sal_uInt8 nId = (i  nCols - 1 ? 0 : 1) + (n ? 2 : 0 );
 if( bUseBoxFmt )
 ::lcl_SetDfltBoxAttr( *pBox, *aBoxFmtArr1, nId );
 else
 {
-bChgSz = 0 == (*aBoxFmtArr2)[ nId ];
 pBoxF = new SwTableBoxFmt ( *::lcl_CreateDfltBoxFmt( 
*this, *aBoxFmtArr2, USHRT_MAX, nId ) );
-if( bChgSz )
-pBoxF-SetFmtAttr( pBox-GetFrmFmt()-GetFrmSize() );
+pBoxF-SetFmtAttr( pBox-GetFrmFmt()-GetFrmSize() );
 pBox-ChgFrmFmt( pBoxF );
 }
 }
commit 873220ff9607f25e1b58073e881f7881a33e8f3c
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Aug 5 12:19:52 2013 +0300

Fix borders on insert table

Checking borders in Insert Table dialog will no longer
prevent the borders of the table style from being correctly
displayed.

Change-Id: Ie9fd2ca19e7ba6355e2de6b9f8d7c954ca3a9c76

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 8b117c5..1cf3585 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -442,7 +442,7 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 
 std::vectorSwTableBoxFmt* aBoxFmtArr;
 SwTableBoxFmt* pBoxFmt = 0;
-if( !bDfltBorders )
+if( !bDfltBorders || pTAFmt )
 {
 pBoxFmt = MakeTableBoxFmt();
 pBoxFmt-SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX / nCols, 0 
));
@@ -460,7 +460,7 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 for( sal_uInt16 i = 0; i  nCols; ++i )
 {
 SwTableBoxFmt *pBoxF;
-if( bDfltBorders )
+if( !pTAFmt  bDfltBorders )
 {
 sal_uInt8 nBoxId = (i  nCols - 1 ? 0 : 1) + (n ? 2 : 0 );
 pBoxF = new SwTableBoxFmt( *::lcl_CreateDfltBoxFmt( *this, 
aBoxFmtArr, nCols, nBoxId) );
commit 59e9d983b8fe4ccb3b752a615ab8d291602447af
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Aug 5 11:54:04 2013 +0300

Some cleanup of the parent assigning

Change-Id: If7b0e0a06e6ffa3a1739be1422548ff0c6460b4f

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index e61a0bb..51c279a 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -121,11 +121,12 @@ public:
 sal_Bool GetRowSplit() const;
 sal_uInt16 GetRepeatHeading() const;
 
-static void RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable table );
-static SwTableFmt* StoreTableProperties( const SwTable table );
+static void RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable rTable );
+static SwTableFmt* StoreTableProperties( const SwTable rTable );
 
-static void AssignLineParents( SwTableFmt* pSrcFmt, SwTable table );
-static void AssignBoxParents( SwTableLineFmt* pSrcLineFmt, SwTableLine 
line );
+static void AssignFormatParents( SwTableFmt* pSrcFmt, SwTable rTable );
+static void AssignLineParents( SwTableFmt* pSrcFmt, SwTable rTable );
+static void AssignBoxParents( SwTableLineFmt* pSrcLineFmt, SwTableLine 
rLine );
 static void AssignLineParents_Complex( SwTableLineFmt* pSrcLineFmt, 
SwTableBoxFmt* pSrcBoxFmt, SwTableBox rBox );
 static void AssignBoxParents_Complex( SwTableLineFmt* pSrcLineFmt, 
SwTableBoxFmt* pSrcBoxFmt, SwTableLine rLine );
 
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 8c91b77..8a798f0 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -230,9 +230,9 @@ sal_uInt16 SwTableFmt::GetRepeatHeading() const
 return 0;
 }
 
-void SwTableFmt::RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable table )
+void SwTableFmt::RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable rTable )
 {
-SwTableFmt *pHardFmt = table.GetTableFmt();
+SwTableFmt *pHardFmt = rTable.GetTableFmt();
 if( !pHardFmt )
 return;
 
@@ -247,33 +247,43 @@ void SwTableFmt::RestoreTableProperties( SwTableFmt

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/inc sw/source

2013-08-02 Thread Alex Ivan
 sw/inc/format.hxx   |1 
 sw/source/core/doc/swtblfmt.cxx |  111 ++--
 2 files changed, 31 insertions(+), 81 deletions(-)

New commits:
commit 5345916a90c80923d7f5a6a621b7461c7ab63f6e
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Aug 2 18:13:24 2013 +0300

Remove default attribute values from Sw*Fmt

These values, because they were being set in the Sw*Fmts from the
hard format, were blocking the attributes from the table style.

All atributes are not yet correctly propagated.

Also, the changes are not instant. There needs to be some other
interaction with the document before they come into effect.

Change-Id: I0c9775c5e988862d67067ac3bc9869851d85945b

diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 62aeace..8c91b77 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -23,14 +23,6 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* 
pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
 {
-SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
-SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
-SetLayoutSplit( sal_True );
-SetCollapsingBorders( sal_True );
-SetRowSplit( sal_True );
-SetRepeatHeading( 0 );
-SetShadow( SvxShadowItem( RES_SHADOW ) );
-
 SwDoc* pDoc = GetDoc();
 
 m_pFstLineFmt.reset( pDoc-MakeTableLineFmt() );
@@ -48,14 +40,6 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const String 
rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
 {
-SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
-SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
-SetLayoutSplit( sal_True );
-SetCollapsingBorders( sal_True );
-SetRowSplit( sal_True );
-SetRepeatHeading( 0 );
-SetShadow( SvxShadowItem( RES_SHADOW ) );
-
 SwDoc* pDoc = GetDoc();
 
 m_pFstLineFmt.reset( pDoc-MakeTableLineFmt() );
@@ -457,74 +441,12 @@ SwTableLineFmt SwTableLineFmt::operator=( const 
SwTableLineFmt rNew )
 SwTableBoxFmt::SwTableBoxFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
-{
-SetFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_FONT ) );
-SetHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_FONTSIZE) );
-SetWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_WEIGHT ) );
-SetPosture( SvxPostureItem( ITALIC_NONE, RES_CHRATR_POSTURE ) );
-
-SetCJKFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_CJK_FONT ) );
-SetCJKHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_CJK_FONTSIZE) );
-SetCJKWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CJK_WEIGHT ) );
-SetCJKPosture( SvxPostureItem( ITALIC_NONE, RES_CHRATR_CJK_POSTURE ) );
-
-SetCTLFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_CTL_FONT ) );
-SetCTLHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_CTL_FONTSIZE) );
-SetCTLWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CTL_WEIGHT ) );
-SetCTLPosture( SvxPostureItem( ITALIC_NONE, RES_CHRATR_CTL_POSTURE ) );
-
-SetUnderline( SvxUnderlineItem( UNDERLINE_NONE, RES_CHRATR_UNDERLINE ) 
);
-SetOverline( SvxOverlineItem( UNDERLINE_NONE, RES_CHRATR_OVERLINE ) );
-SetCrossedOut( SvxCrossedOutItem( STRIKEOUT_NONE, 
RES_CHRATR_CROSSEDOUT ) );
-SetContour( SvxContourItem( sal_False, RES_CHRATR_CONTOUR ) );
-SetShadowed( SvxShadowedItem( sal_False, RES_CHRATR_SHADOWED ) );
-SetColor( SvxColorItem( RES_CHRATR_COLOR ) );
-SvxBoxItem rNew = SvxBoxItem( RES_BOX );
-rNew.SetDistance( 55 );
-SetBox( rNew );
-SetBackground( SvxBrushItem( RES_BACKGROUND ) );
-SetAdjust( SvxAdjustItem( SVX_ADJUST_LEFT, RES_PARATR_ADJUST ) );
-SetTextOrientation( SvxFrameDirectionItem( FRMDIR_ENVIRONMENT, 
RES_FRAMEDIR ) );
-SetVerticalAlignment( SwFmtVertOrient( 0, 
com::sun::star::text::VertOrientation::NONE, 
com::sun::star::text::RelOrientation::FRAME ) );
-
-eSysLanguage = eNumFmtLanguage = ::GetAppLanguage();
-}
+{}
 
 SwTableBoxFmt::SwTableBoxFmt( SwAttrPool rPool, const String rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
-{
-SetFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_FONT ) );
-SetHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_FONTSIZE) );
-SetWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_WEIGHT ) );
-SetPosture( SvxPostureItem( ITALIC_NONE, RES_CHRATR_POSTURE ) );
-
-SetCJKFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_CJK_FONT

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-08-01 Thread Alex Ivan
 sw/inc/swtblfmt.hxx  |5 ++
 sw/source/core/doc/swtblfmt.cxx  |   95 +++
 sw/source/core/docnode/ndtbl.cxx |   23 -
 3 files changed, 111 insertions(+), 12 deletions(-)

New commits:
commit ee61450df68e7cc539720d95c7f470f7b56c4cda
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Aug 1 20:39:52 2013 +0300

Register SwFmts to correct parents for each element of table

Insert table, text to table and set autoformat methods now set the
parent of each SwFmt to the correct element in the table style.
For more complex tables, i.e. boxes contain other lines and so on,
the parents for these are set to the same as the line/box in which
they are found.

Change-Id: I24bc35323414bc8bdceda610da7ba53da043f09b

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 0443cbd..e61a0bb 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -124,6 +124,11 @@ public:
 static void RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable table );
 static SwTableFmt* StoreTableProperties( const SwTable table );
 
+static void AssignLineParents( SwTableFmt* pSrcFmt, SwTable table );
+static void AssignBoxParents( SwTableLineFmt* pSrcLineFmt, SwTableLine 
line );
+static void AssignLineParents_Complex( SwTableLineFmt* pSrcLineFmt, 
SwTableBoxFmt* pSrcBoxFmt, SwTableBox rBox );
+static void AssignBoxParents_Complex( SwTableLineFmt* pSrcLineFmt, 
SwTableBoxFmt* pSrcBoxFmt, SwTableLine rLine );
+
 sal_Bool Load( SvStream rStream, const SwAfVersions rVersions, SwDoc* 
pDoc, sal_uInt16 nVal );
 
 TYPEINFO(); // Already in base class Content.
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index db24264..c771894 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -269,6 +269,8 @@ void SwTableFmt::RestoreTableProperties( SwTableFmt* 
pSrcFmt, SwTable table )
 else
 pTableStyle-Remove( pHardFmt );
 
+AssignLineParents( pSrcFmt, table );
+
 SwEditShell *pShell = pDoc-GetEditShell();
 pDoc-SetRowSplit( *pShell-getShellCrsr( false ), SwFmtRowSplit( 
bRowSplit ) );
 
@@ -284,6 +286,99 @@ SwTableFmt* SwTableFmt::StoreTableProperties( const 
SwTable table )
 return (SwTableFmt*)pHardFmt-GetRegisteredIn();
 }
 
+void SwTableFmt::AssignLineParents( SwTableFmt* pSrcFmt, SwTable rTable )
+{
+sal_uInt16 nLines = rTable.GetTabLines().size();
+for( sal_uInt16 n = 0; n  nLines; ++n )
+{
+SwTableLineFmt* pLineFmt = (SwTableLineFmt*)rTable.GetTabLines()[ n 
]-GetFrmFmt();
+SwTableLineFmt* pFmt = 0;
+
+if( pSrcFmt )
+{
+if( !n )
+pFmt = pSrcFmt-GetFirstLineFmt();
+else if( n == nLines - 1 )
+pFmt = pSrcFmt-GetLastLineFmt();
+else if( n  1 )
+pFmt = pSrcFmt-GetEvenLineFmt();
+else
+pFmt = pSrcFmt-GetOddLineFmt();
+}
+
+if( pFmt )
+pLineFmt-RegisterToFormat( *pFmt );
+else if( pLineFmt-GetRegisteredIn() )
+((SwTableLineFmt*)pLineFmt-GetRegisteredIn())-Remove( pLineFmt );
+
+AssignBoxParents( pFmt, *rTable.GetTabLines()[ n ] );
+}
+}
+
+void SwTableFmt::AssignBoxParents( SwTableLineFmt* pSrcLineFmt, SwTableLine 
rLine )
+{
+sal_uInt16 nBoxes = rLine.GetTabBoxes().size();
+for( sal_uInt16 n = 0; n  nBoxes; ++n )
+{
+SwTableBoxFmt* pBoxFmt = (SwTableBoxFmt*)rLine.GetTabBoxes()[ n 
]-GetFrmFmt();
+SwTableBoxFmt* pFmt = 0;
+
+if( pSrcLineFmt )
+{
+if( !n )
+pFmt = pSrcLineFmt-GetFirstBoxFmt();
+else if( n == nBoxes - 1 )
+pFmt = pSrcLineFmt-GetLastBoxFmt();
+else if( n  1 )
+pFmt = pSrcLineFmt-GetEvenBoxFmt();
+else
+pFmt = pSrcLineFmt-GetOddBoxFmt();
+}
+
+if( pFmt )
+pBoxFmt-RegisterToFormat( *pFmt );
+else if( pBoxFmt-GetRegisteredIn() )
+((SwTableBoxFmt*)pBoxFmt-GetRegisteredIn())-Remove( pBoxFmt );
+
+
+if( rLine.GetTabBoxes()[ n ]-GetTabLines().size() )
+AssignLineParents_Complex( pSrcLineFmt, pFmt, 
*rLine.GetTabBoxes()[ n ] );
+}
+}
+
+void SwTableFmt::AssignLineParents_Complex( SwTableLineFmt* pSrcLineFmt, 
SwTableBoxFmt* pSrcBoxFmt, SwTableBox rBox )
+{
+sal_uInt16 nLines = rBox.GetTabLines().size();
+for( sal_uInt16 n = 0; n  nLines; ++n )
+{
+SwTableLineFmt* pLineFmt = (SwTableLineFmt*)rBox.GetTabLines()[ n 
]-GetFrmFmt();
+
+if( pSrcLineFmt )
+pLineFmt-RegisterToFormat( *pSrcLineFmt );
+else
+((SwTableLineFmt*)pLineFmt-GetRegisteredIn())-Remove( pLineFmt );
+
+AssignBoxParents_Complex( pSrcLineFmt, pSrcBoxFmt, 
*rBox.GetTabLines()[ n ] );
+}
+}
+
+void SwTableFmt::AssignBoxParents_Complex( SwTableLineFmt

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/source

2013-07-30 Thread Alex Ivan
 sw/source/core/bastyp/init.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 32ce2fc84491847d26576f3af454cb9e86cfc26a
Author: Alex Ivan alexni...@yahoo.com
Date:   Tue Jul 30 18:32:05 2013 +0300

Fix missing font attributes in AutoFormat window

The attribute range associated with the SwTableBoxFmt did not
include the necessary ids for character attributes, and as a
result, these were not stored and not used correctly.

The solution should not have any side-effects, but, to be sure
there should be further testing of other features where this
range came into use.

Change-Id: I8cb1ac881b2746ae3ec7958a958167de6f140a7f

diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 934c821..148202c 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -209,6 +209,7 @@ sal_uInt16 aTableBoxSetRange[] = {
 RES_PROTECT,RES_PROTECT,
 RES_VERT_ORIENT,RES_VERT_ORIENT,
 RES_FRAMEDIR,   RES_FRAMEDIR,
+RES_CHRATR_BEGIN,   RES_CHRATR_END-1,
 RES_BOXATR_BEGIN,   RES_BOXATR_END-1,
 RES_UNKNOWNATR_BEGIN, RES_UNKNOWNATR_END-1,
 0
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - 3 commits - sw/source

2013-07-29 Thread Alex Ivan
 sw/source/core/doc/swtblfmt.cxx |7 ++-
 sw/source/ui/table/tautofmt.cxx |6 ++
 2 files changed, 8 insertions(+), 5 deletions(-)

New commits:
commit 0e010db7b2a98bada410ec2f2e36b61ce09f74f5
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Jul 29 19:37:51 2013 +0300

Temporary disable of AutoFormat save mechanism

Temporarily disabled saving any modification to the existing
table format file upon closing the AutoFormat window.
Most likely, further modifications will be made to this once
it is clear how the table styles will be stored.

Change-Id: I894d10003876044ba0b08c462fc0b6622bbb2595

diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index eb92dc2..da75280 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -178,8 +178,6 @@ SwAutoFormatDlg::SwAutoFormatDlg( Window* pParent, 
SwWrtShell* pWrtShell,
 
 SwAutoFormatDlg::~SwAutoFormatDlg()
 {
-if (bCoreDataChanged)
-pTableTbl-Save();
 delete pTableTbl;
 }
 
commit 673df31f09fb7a8e52e836ca514d07c6ef10647b
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Jul 29 19:17:21 2013 +0300

Fix resizing of AutoFormat window crashing

An incorrect modification of the pointer to the currently
selected style caused a crash if a resize of the respective
window was attempted.

Change-Id: Ibb66f1256268820db5440871c30a9697a0634f87

diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index bdb2478..eb92dc2 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -478,7 +478,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFmtHdl)
 String sNm;
 // FIXME Yuk! we are creating the table styles ATM, but in the 
targetted
 // ideal, the table styles are created with the document
-SwStyleNameMapper::GetUIName( RES_POOLCOLL_STANDARD, sNm );
+sNm = SwStyleNameMapper::GetUIName( RES_POOLCOLL_STANDARD, sNm );
 SwTableFmt* pStyle = pShell-GetDoc()-FindTblFmtByName(sNm);
 if ( !pStyle )
 pStyle = pShell-GetDoc()-MakeTblFrmFmt(sNm, NULL);
@@ -491,7 +491,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFmtHdl)
 aTmp.SetWidthHeight( sal_False );
 
 if( nOldIdx != nIndex )
-m_pWndPreview-NotifyChange( aTmp );
+m_pWndPreview-NotifyChange( *(SwTableAutoFmt*)0 );
 UpdateChecks( aTmp, sal_False );
 }
 
commit 1658441f88b267f6e2ba0344066bbddca444ecc4
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Jul 29 13:57:47 2013 +0300

Fix RepeatHeading storage in SwTableFmt

Fixed an issue where improper storage of the RepeatHeading value
in SwTableFmt would cause a crash upon attempting to retrieve
the value.

Change-Id: I655d4f1f9760bc9e95c53c8fe292ea761e25fefd

diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 15c63c7..db24264 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -238,7 +238,12 @@ sal_Bool SwTableFmt::GetRowSplit() const
 
 sal_uInt16 SwTableFmt::GetRepeatHeading() const
 {
-return (static_castconst SfxUInt16Item( GetFmtAttr( 
FN_PARAM_TABLE_HEADLINE ) )).GetValue();
+const SfxPoolItem* pItem;
+
+if( SFX_ITEM_SET == GetItemState( FN_PARAM_TABLE_HEADLINE, sal_False, 
pItem ) )
+return ((const SfxUInt16Item*)pItem)-GetValue();
+
+return 0;
 }
 
 void SwTableFmt::RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable table )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/inc sw/source

2013-07-26 Thread Alex Ivan
 sw/inc/swtblfmt.hxx  |6 +--
 sw/source/core/doc/swtblfmt.cxx  |   61 ++-
 sw/source/core/doc/tblafmt.cxx   |6 +--
 sw/source/core/docnode/ndtbl.cxx |2 -
 sw/source/core/undo/untbl.cxx|4 +-
 5 files changed, 31 insertions(+), 48 deletions(-)

New commits:
commit 5d8b4793247eedb5d02c52356d0dcc37d45290a1
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Jul 26 19:51:15 2013 +0300

Further changes on separating hard formatting from style

Changes have been made to better distinguish table style from the
table's hard format. These concern setting the table style on
a certain table and the associated Undo/Redo operation.

Some errors still need to be sorted out.

Change-Id: Id7593616b89234301fb33352d46a83aca7c3ac90

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index d49396a..0443cbd 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -121,10 +121,8 @@ public:
 sal_Bool GetRowSplit() const;
 sal_uInt16 GetRepeatHeading() const;
 
-void RestoreTableProperties( SwTable table ) const;
-void StoreTableProperties( const SwTable table );
-
-void CopyTableFormatInfo( const SwTableFmt* pTableFormat );
+static void RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable table );
+static SwTableFmt* StoreTableProperties( const SwTable table );
 
 sal_Bool Load( SvStream rStream, const SwAfVersions rVersions, SwDoc* 
pDoc, sal_uInt16 nVal );
 
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index e4a3a89..15c63c7 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -241,57 +241,42 @@ sal_uInt16 SwTableFmt::GetRepeatHeading() const
 return (static_castconst SfxUInt16Item( GetFmtAttr( 
FN_PARAM_TABLE_HEADLINE ) )).GetValue();
 }
 
-void SwTableFmt::RestoreTableProperties(SwTable table) const
+void SwTableFmt::RestoreTableProperties( SwTableFmt* pSrcFmt, SwTable table )
 {
-SwTableFmt *pFormat = (SwTableFmt*)table.GetTableFmt()-GetRegisteredIn();
-if (!pFormat)
+SwTableFmt *pHardFmt = table.GetTableFmt();
+if( !pHardFmt )
 return;
 
-SwDoc *pDoc = pFormat-GetDoc();
-if (!pDoc)
+SwDoc *pDoc = pHardFmt-GetDoc();
+if( !pDoc )
 return;
 
-pFormat-CopyTableFormatInfo( this );
+SwTableFmt *pTableStyle = (SwTableFmt*)pHardFmt-GetRegisteredIn();
+sal_Bool bRowSplit = sal_True;
+sal_uInt16 nRepeatHeading = 0;
 
-SwEditShell *pShell = pDoc-GetEditShell();
-pDoc-SetRowSplit( *pShell-getShellCrsr( false ), SwFmtRowSplit( 
GetRowSplit() ) );
-
-table.SetRowsToRepeat( GetRepeatHeading() );
-}
-
-void SwTableFmt::StoreTableProperties(const SwTable table)
-{
-SwTableFmt *pFormat = (SwTableFmt*)table.GetTableFmt()-GetRegisteredIn();
-if (!pFormat)
-return;
-
-SwDoc *pDoc = pFormat-GetDoc();
-if (!pDoc)
-return;
+if( pSrcFmt )
+{
+pHardFmt-RegisterToFormat( *pSrcFmt );
+bRowSplit = pSrcFmt-GetRowSplit();
+nRepeatHeading = pSrcFmt-GetRepeatHeading();
+}
+else
+pTableStyle-Remove( pHardFmt );
 
 SwEditShell *pShell = pDoc-GetEditShell();
-SwFmtRowSplit *pRowSplit = 0;
-pDoc-GetRowSplit( *pShell-getShellCrsr( false ), pRowSplit );
-SetRowSplit( pRowSplit ? pRowSplit-GetValue() : sal_False );
-delete pRowSplit;
-pRowSplit = 0;
+pDoc-SetRowSplit( *pShell-getShellCrsr( false ), SwFmtRowSplit( 
bRowSplit ) );
 
-CopyTableFormatInfo( pFormat );
+table.SetRowsToRepeat( nRepeatHeading );
 }
 
-void SwTableFmt::CopyTableFormatInfo( const SwTableFmt* pTableFormat )
+SwTableFmt* SwTableFmt::StoreTableProperties( const SwTable table )
 {
-SetFmtAttr( pTableFormat-GetAttrSet() );
-
-m_pFstLineFmt.reset( new SwTableLineFmt ( *pTableFormat-GetFirstLineFmt() 
) );
-m_pLstLineFmt.reset( new SwTableLineFmt ( *pTableFormat-GetLastLineFmt() 
) );
-m_pOddLineFmt.reset( new SwTableLineFmt ( *pTableFormat-GetOddLineFmt() ) 
);
-m_pEvnLineFmt.reset( new SwTableLineFmt ( *pTableFormat-GetEvenLineFmt() 
) );
+SwTableFmt *pHardFmt = table.GetTableFmt();
+if( !pHardFmt )
+return NULL;
 
-m_pFstColFmt.reset( new SwTableLineFmt ( *pTableFormat-GetFirstColFmt() ) 
);
-m_pLstColFmt.reset( new SwTableLineFmt ( *pTableFormat-GetLastColFmt() ) 
);
-m_pOddColFmt.reset( new SwTableLineFmt ( *pTableFormat-GetOddColFmt() ) );
-m_pEvnColFmt.reset( new SwTableLineFmt ( *pTableFormat-GetEvenColFmt() ) 
);
+return (SwTableFmt*)pHardFmt-GetRegisteredIn();
 }
 
 SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index ef80167..8881553 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -751,12 +751,12 @@ void SwTableAutoFmt::UpdateToSet(sal_uInt8 nPos, 
SfxItemSet rSet,
 
 void SwTableAutoFmt

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/source

2013-07-23 Thread Alex Ivan
 sw/source/core/docnode/ndtbl.cxx |   21 +++--
 1 file changed, 7 insertions(+), 14 deletions(-)

New commits:
commit 338f4d7f21180a997fdd045669fb0c09f2e3
Author: Alex Ivan alexni...@yahoo.com
Date:   Tue Jul 23 17:00:46 2013 +0300

Fix hard format/table style separation issue

Fixed the failed unit test brought by the previous
patch which attempted to correctly separate the hard
format from the table style in table insertion and
text to table methods.

Change-Id: I5eb7ddf074c8c8aaf2b2ec58aa7a94db8792a309

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index eaa15ac..cefcef2 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -329,8 +329,8 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 
 // Create the Box/Line/Table construct
 SwTableLineFmt* pLineFmt = MakeTableLineFmt();
-SwTableFmt* pTableFmt = pTAFmt ? pTAFmt-GetTableStyle()
-: MakeTblFrmFmt( aTblName, GetDfltFrmFmt() );
+SwTableFmt* pTableStyle = pTAFmt ? pTAFmt-GetTableStyle() : NULL;
+SwTableFmt* pTableFmt = MakeTblFrmFmt( aTblName, pTableStyle );
 
 /* If the node to insert the table at is a context node and has a
non-default FRAMEDIR propagate it to the table. */
@@ -350,10 +350,6 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 pTableFmt-SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
 // All lines use the left-to-right Fill-Order!
 pLineFmt-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
-pTableFmt-GetFirstLineFmt()-SetFmtAttr( SwFmtFillOrder( 
ATT_LEFT_TO_RIGHT ) );
-pTableFmt-GetOddLineFmt()-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT 
) );
-pTableFmt-GetEvenLineFmt()-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT 
) );
-pTableFmt-GetLastLineFmt()-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT 
) );
 
 // Set USHRT_MAX as the Table's default SSize
 SwTwips nWidth = USHRT_MAX;
@@ -404,7 +400,7 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 ::lcl_SetDfltBorders( pTableFmt );
 
 SwTable * pNdTbl = pTblNd-GetTable();
-pNdTbl-GetTableFmt()-RegisterToFormat( *pTableFmt );
+pNdTbl-RegisterToFormat( *pTableFmt );
 
 pNdTbl-SetRowsToRepeat( nRowsToRepeat );
 pNdTbl-SetTableModel( bNewModel );
@@ -603,15 +599,11 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions rInsTblOpts,
 // Create the Box/Line/Table construct
 SwTableBoxFmt* pBoxFmt = MakeTableBoxFmt();
 SwTableLineFmt* pLineFmt = MakeTableLineFmt();
-SwTableFmt* pTableFmt = pTAFmt ? pTAFmt-GetTableStyle()
-: MakeTblFrmFmt( GetUniqueTblName(), GetDfltFrmFmt() );
+SwTableFmt* pTableStyle = pTAFmt ? pTAFmt-GetTableStyle() : NULL;
+SwTableFmt* pTableFmt = MakeTblFrmFmt( GetUniqueTblName(), pTableStyle );
 
 // All Lines have a left-to-right Fill Order
 pLineFmt-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
-pTableFmt-GetFirstLineFmt()-SetFmtAttr( SwFmtFillOrder( 
ATT_LEFT_TO_RIGHT ));
-pTableFmt-GetOddLineFmt()-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT 
));
-pTableFmt-GetEvenLineFmt()-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT 
));
-pTableFmt-GetLastLineFmt()-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT 
));
 // The Table's SSize is USHRT_MAX
 pTableFmt-SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE, USHRT_MAX ));
 if( !(rInsTblOpts.mnInsMode  tabopts::SPLIT_LAYOUT) )
@@ -658,7 +650,8 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions rInsTblOpts,
 
 // Set Orientation in the Table's Fmt
 pTableFmt-SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
-pNdTbl-GetTableFmt()-RegisterToFormat( *pTableFmt );
+
+pNdTbl-RegisterToFormat( *pTableFmt );
 
 if( rInsTblOpts.mnInsMode  tabopts::DEFAULT_BORDER )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - 5 commits - sw/source

2013-07-21 Thread Alex Ivan
 sw/source/core/doc/swtblfmt.cxx  |4 
 sw/source/core/docnode/ndtbl.cxx |  184 ---
 sw/source/core/inc/UndoTable.hxx |7 -
 sw/source/core/undo/untbl.cxx|   44 +
 4 files changed, 17 insertions(+), 222 deletions(-)

New commits:
commit 74fe564c6772707be3b978d12473ff69ae66843e
Author: Alex Ivan alexni...@yahoo.com
Date:   Sun Jul 21 19:19:43 2013 +0300

Separated hardformatting/styles in table insertion

Had previously overlooked where the table style information was
stored when inserting a new table into the document.

Change-Id: I8b285951c76fabe9b3b24006bba8592a3a6e5364

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index 6e38a77..eaa15ac 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -404,7 +404,7 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 ::lcl_SetDfltBorders( pTableFmt );
 
 SwTable * pNdTbl = pTblNd-GetTable();
-pNdTbl-RegisterToFormat( *pTableFmt );
+pNdTbl-GetTableFmt()-RegisterToFormat( *pTableFmt );
 
 pNdTbl-SetRowsToRepeat( nRowsToRepeat );
 pNdTbl-SetTableModel( bNewModel );
@@ -658,7 +658,7 @@ const SwTable* SwDoc::TextToTable( const 
SwInsertTableOptions rInsTblOpts,
 
 // Set Orientation in the Table's Fmt
 pTableFmt-SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
-pNdTbl-RegisterToFormat( *pTableFmt );
+pNdTbl-GetTableFmt()-RegisterToFormat( *pTableFmt );
 
 if( rInsTblOpts.mnInsMode  tabopts::DEFAULT_BORDER )
 {
commit 248c76291562f2fe95c2f246be06cbd7338fcb3e
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Jul 18 18:45:14 2013 +0300

Modify undo mechanism for applying table format

Undo object no longer reconstructs table, but changes the table
style back to the original. The actual modification _should_
become visible once the proper modifications to the rendering of
the table are done.

Change-Id: Ife10f52077c9b13d5cf4f44fa1194fe414661cd1

diff --git a/sw/source/core/inc/UndoTable.hxx b/sw/source/core/inc/UndoTable.hxx
index cd79f20..37f5c41 100644
--- a/sw/source/core/inc/UndoTable.hxx
+++ b/sw/source/core/inc/UndoTable.hxx
@@ -43,6 +43,7 @@ class SwTable;
 class SwTableBox;
 class SwStartNode;
 class SwTableNode;
+class SwTableFmt;
 class SwTableAutoFmt;
 class SwTableSortBoxes;
 
@@ -146,9 +147,7 @@ class SwUndoTblNumFmt;
 class SwUndoTblAutoFmt : public SwUndo
 {
 sal_uLong nSttNode;
-_SaveTable* pSaveTbl;
-::std::vector ::boost::shared_ptrSwUndoTblNumFmt  m_Undos;
-sal_Bool bSaveCntntAttr;
+SwTableFmt* pSaveFmt;
 sal_uInt16 m_nRepeatHeading;
 
 void UndoRedo(bool const bUndo, ::sw::UndoRedoContext  rContext);
@@ -160,8 +159,6 @@ public:
 
 virtual void UndoImpl( ::sw::UndoRedoContext  );
 virtual void RedoImpl( ::sw::UndoRedoContext  );
-
-void SaveBoxCntnt( const SwTableBox rBox );
 };
 
 class SwUndoTblNdsChg : public SwUndo, private boost::noncopyable
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index a3793d2..4157e53 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1410,29 +1410,14 @@ SwUndoTblAutoFmt::SwUndoTblAutoFmt( const SwTableNode 
rTblNd,
 const SwTableAutoFmt rAFmt )
 : SwUndo( UNDO_TABLE_AUTOFMT ),
 nSttNode( rTblNd.GetIndex() ),
-bSaveCntntAttr( sal_False )
-, m_nRepeatHeading(rTblNd.GetTable().GetRowsToRepeat())
+m_nRepeatHeading(rTblNd.GetTable().GetRowsToRepeat())
 {
-pSaveTbl = new _SaveTable( rTblNd.GetTable() );
-
-if( rAFmt.IsFont() || rAFmt.IsJustify() )
-{
-// than also go over the ContentNodes of the EndBoxes and collect
-// all paragraph attributes
-pSaveTbl-SaveCntntAttrs( (SwDoc*)rTblNd.GetDoc() );
-bSaveCntntAttr = sal_True;
-}
+pSaveFmt = new SwTableFmt( *rAFmt.GetTableStyle() );
 }
 
 SwUndoTblAutoFmt::~SwUndoTblAutoFmt()
 {
-delete pSaveTbl;
-}
-
-void SwUndoTblAutoFmt::SaveBoxCntnt( const SwTableBox rBox )
-{
-::boost::shared_ptrSwUndoTblNumFmt const p(new SwUndoTblNumFmt(rBox));
-m_Undos.push_back(p);
+delete pSaveFmt;
 }
 
 void
@@ -1443,25 +1428,14 @@ SwUndoTblAutoFmt::UndoRedo(bool const bUndo, 
::sw::UndoRedoContext  rContext)
 OSL_ENSURE( pTblNd, no TableNode );
 
 SwTable table = pTblNd-GetTable();
-_SaveTable* pOrig = new _SaveTable( table );
-// than go also over the ContentNodes of the EndBoxes and collect
-// all paragraph attributes
-if( bSaveCntntAttr )
-pOrig-SaveCntntAttrs( rDoc );
+SwTableFmt* pOrig = new SwTableFmt( 
*(SwTableFmt*)table.GetTableFmt()-GetRegisteredIn() );
 
-if (bUndo)
-{
-for (size_t n = m_Undos.size(); 0  n; --n)
-{
-m_Undos.at(n-1)-UndoImpl(rContext);
-}
+if( bUndo )
+table.SetRowsToRepeat( m_nRepeatHeading

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/inc sw/source

2013-07-13 Thread Alex Ivan
Rebased ref, commits from common ancestor:
commit 2a5e7162fa3b916cd1a4925bec8e474896d98739
Author: Alex Ivan alexni...@yahoo.com
Date:   Sat Jul 13 19:41:47 2013 +0300

Modify InsertTable and TableToText methods

The mentioned methods have been modified in order to use the
table style provided as parameter, if present, and the default
frame format if not.

Furthermore, the style is just assigned to the table, rather than
applying the properties immediately. Currently, the style is not
applied, but it will be at render time once the neccesary modifications
are made.

Change-Id: I982ad0539da27e87f3d7443e6a9756503d83be27

diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index f8b224f..a24 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -134,77 +134,16 @@ static void lcl_SetDfltBoxAttr( SwFrmFmt rFmt, sal_uInt8 
nId )
 rFmt.SetFmtAttr( aBox );
 }
 
-typedef std::mapSwFrmFmt *, SwTableBoxFmt * DfltBoxAttrMap_t;
-typedef std::vectorDfltBoxAttrMap_t * DfltBoxAttrList_t;
-
-static void
-lcl_SetDfltBoxAttr(SwTableBox rBox, DfltBoxAttrList_t  rBoxFmtArr,
-sal_uInt8 const nId, SwTableAutoFmt const*const pAutoFmt = 0)
-{
-DfltBoxAttrMap_t * pMap = rBoxFmtArr[ nId ];
-if (!pMap)
-{
-pMap = new DfltBoxAttrMap_t;
-rBoxFmtArr[ nId ] = pMap;
-}
-
-SwTableBoxFmt* pNewTableBoxFmt = 0;
-SwFrmFmt* pBoxFrmFmt = rBox.GetFrmFmt();
-DfltBoxAttrMap_t::iterator const iter(pMap-find(pBoxFrmFmt));
-if (pMap-end() != iter)
-{
-pNewTableBoxFmt = iter-second;
-}
-else
-{
-SwDoc* pDoc = pBoxFrmFmt-GetDoc();
-// format does not exist, so create it
-pNewTableBoxFmt = pDoc-MakeTableBoxFmt();
-pNewTableBoxFmt-SetFmtAttr( pBoxFrmFmt-GetAttrSet().Get( 
RES_FRM_SIZE ) );
-
-if( pAutoFmt )
-pAutoFmt-UpdateToSet( nId, 
(SfxItemSet)pNewTableBoxFmt-GetAttrSet(),
-SwTableAutoFmt::UPDATE_BOX,
-pDoc-GetNumberFormatter( sal_True ) );
-else
-::lcl_SetDfltBoxAttr( *pNewTableBoxFmt, nId );
-
-(*pMap)[pBoxFrmFmt] = pNewTableBoxFmt;
-}
-rBox.ChgFrmFmt( pNewTableBoxFmt );
-}
-
-static SwTableBoxFmt *lcl_CreateDfltBoxFmt( SwDoc rDoc, 
std::vectorSwTableBoxFmt* rBoxFmtArr,
-sal_uInt16 nCols, sal_uInt8 nId )
-{
-if ( !rBoxFmtArr[nId] )
-{
-SwTableBoxFmt* pBoxFmt = rDoc.MakeTableBoxFmt();
-if( USHRT_MAX != nCols )
-pBoxFmt-SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE,
-USHRT_MAX / nCols, 0 ));
-::lcl_SetDfltBoxAttr( *pBoxFmt, nId );
-rBoxFmtArr[ nId ] = pBoxFmt;
-}
-return rBoxFmtArr[nId];
-}
-
-static SwTableBoxFmt *lcl_CreateAFmtBoxFmt( SwDoc rDoc, 
std::vectorSwTableBoxFmt* rBoxFmtArr,
-const SwTableAutoFmt rAutoFmt,
-sal_uInt16 nCols, sal_uInt8 nId )
+static void lcl_SetDfltBorders( SwTableFmt* pFmt )
 {
-if( !rBoxFmtArr[nId] )
+for( sal_uInt8 n = 0; n  4; ++n )
 {
-SwTableBoxFmt* pBoxFmt = rDoc.MakeTableBoxFmt();
-rAutoFmt.UpdateToSet( nId, (SfxItemSet)pBoxFmt-GetAttrSet(),
-SwTableAutoFmt::UPDATE_BOX,
-rDoc.GetNumberFormatter( sal_True ) );
-if( USHRT_MAX != nCols )
-pBoxFmt-SetFmtAttr( SwFmtFrmSize( ATT_VAR_SIZE,
-USHRT_MAX / nCols, 0 ));
-rBoxFmtArr[ nId ] = pBoxFmt;
+for( sal_uInt8 i = 0; i  4; i++ )
+{
+sal_uInt8 nId = (i  3 ? 0 : 1) + (n ? 2 : 0);
+::lcl_SetDfltBoxAttr( *pFmt-GetBoxFmt( 4 * n + i ), nId );
+}
 }
-return rBoxFmtArr[nId];
 }
 
 SwTableNode* SwDoc::IsIdxInTbl(const SwNodeIndex rIdx)
@@ -390,7 +329,8 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 
 // Create the Box/Line/Table construct
 SwTableLineFmt* pLineFmt = MakeTableLineFmt();
-SwTableFmt* pTableFmt = MakeTblFrmFmt( aTblName, GetDfltFrmFmt() );
+SwTableFmt* pTableFmt = pTAFmt ? pTAFmt-GetTableStyle()
+: MakeTblFrmFmt( aTblName, GetDfltFrmFmt() );
 
 /* If the node to insert the table at is a context node and has a
non-default FRAMEDIR propagate it to the table. */
@@ -409,7 +349,11 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 // Set Orientation at the Table's Fmt
 pTableFmt-SetFmtAttr( SwFmtHoriOrient( 0, eAdjust ) );
 // All lines use the left-to-right Fill-Order!
-pLineFmt-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ));
+pLineFmt-SetFmtAttr( SwFmtFillOrder( ATT_LEFT_TO_RIGHT ) );
+pTableFmt-GetFirstLineFmt()-SetFmtAttr( SwFmtFillOrder( 
ATT_LEFT_TO_RIGHT

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-07-08 Thread Alex Ivan
 sw/inc/swtblfmt.hxx  |9 ++
 sw/inc/tblafmt.hxx   |2 -
 sw/source/core/doc/swtblfmt.cxx  |   34 --
 sw/source/core/docnode/ndtbl.cxx |   58 +++
 4 files changed, 81 insertions(+), 22 deletions(-)

New commits:
commit b60730b1768f19cdddf738d23712786853e839c6
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Jul 8 20:54:39 2013 +0300

Use SwTableFmt in InsertTable method

Partially replaced the role of SwTableAutoFormat in
insertTable method with SwTableFmt.

Change-Id: Icfe402d711bda17acd1aa8c2a5ac819a438c7d74

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index d49396a..03c3974 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -40,9 +40,12 @@
 #include editeng/formatbreakitem.hxx
 #include editeng/keepitem.hxx
 #include editeng/lineitem.hxx
+#include editeng/lrspitem.hxx
 #include editeng/frmdiritem.hxx
 #include editeng/shaditem.hxx
 #include editsh.hxx
+#include fmtfordr.hxx
+#include fmtfsize.hxx
 #include fmtpdsc.hxx
 #include fmtlsplt.hxx
 #include fmtornt.hxx
@@ -114,6 +117,10 @@ public:
 void SetRowSplit( const sal_Bool rNew );
 void SetRepeatHeading( const sal_uInt16 rNew );
 void SetShadow( const SvxShadowItem rNew );
+void SetFrameDir( const SvxFrameDirectionItem rNew );
+void SetHoriOrient( const SwFmtHoriOrient rNew );
+void SetLRSpace( const SvxLRSpaceItem rNew );
+void SetFmtFrmSize( const SwFmtFrmSize rNew );
 
 const SvxFmtKeepItem GetKeepWithNextPara() const;
 sal_Bool GetLayoutSplit() const;
@@ -164,6 +171,8 @@ public:
 SwTableBoxFmt* GetOddBoxFmt() { return m_pOddBoxFmt.get(); }
 SwTableBoxFmt* GetEvenBoxFmt() { return m_pEvnBoxFmt.get(); }
 
+void SetFillOrder( const SwFmtFillOrder rNew );
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt)
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index a1e59b3..b095765 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -128,7 +128,7 @@ public:
 
 SwTableAutoFmt operator=( const SwTableAutoFmt rNew );
 
-SwTableFmt* GetTableStyle() { return m_pTableStyle; }
+SwTableFmt* GetTableStyle() const { return m_pTableStyle; }
 
 void SetBoxFmt( const SwTableBoxFmt rNew, sal_uInt8 nPos );
 SwTableBoxFmt* GetBoxFmt( sal_uInt8 nPos ) const;
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 5e348e7..393218c 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -117,9 +117,9 @@ void SwTableFmt::SetBoxFmt( const SwTableBoxFmt rNew, 
sal_uInt8 nPos )
 case 0:
 pLine = m_pFstLineFmt.get(); break;
 case 1:
-pLine = m_pOddLineFmt.get(); break;
-case 2:
 pLine = m_pEvnLineFmt.get(); break;
+case 2:
+pLine = m_pOddLineFmt.get(); break;
 case 3:
 pLine = m_pLstLineFmt.get(); break;
 // TODO Extend for columns
@@ -130,9 +130,9 @@ void SwTableFmt::SetBoxFmt( const SwTableBoxFmt rNew, 
sal_uInt8 nPos )
 case 0:
 pLine-SetFirstBoxFmt( new SwTableBoxFmt( rNew ) ); break;
 case 1:
-pLine-SetOddBoxFmt( new SwTableBoxFmt( rNew ) ); break;
-case 2:
 pLine-SetEvenBoxFmt( new SwTableBoxFmt( rNew ) ); break;
+case 2:
+pLine-SetOddBoxFmt( new SwTableBoxFmt( rNew ) ); break;
 case 3:
 pLine-SetLastBoxFmt( new SwTableBoxFmt( rNew ) ); break;
 }
@@ -216,6 +216,27 @@ void SwTableFmt::SetShadow( const SvxShadowItem rNew )
 SetFmtAttr( rNew );
 }
 
+void SwTableFmt::SetFrameDir( const SvxFrameDirectionItem rNew )
+{
+SetFmtAttr( rNew );
+}
+
+
+void SwTableFmt::SetHoriOrient( const SwFmtHoriOrient rNew )
+{
+SetFmtAttr( rNew );
+}
+
+void SwTableFmt::SetLRSpace( const SvxLRSpaceItem rNew )
+{
+SetFmtAttr( rNew );
+}
+
+void SwTableFmt::SetFmtFrmSize( const SwFmtFrmSize rNew )
+{
+SetFmtAttr( rNew );
+}
+
 const SvxFmtKeepItem SwTableFmt::GetKeepWithNextPara() const
 {
 return SwFmt::GetKeep();
@@ -342,6 +363,11 @@ SwTableLineFmt SwTableLineFmt::operator=( const 
SwTableLineFmt rNew )
 return *this;
 }
 
+void SwTableLineFmt::SetFillOrder( const SwFmtFillOrder rNew )
+{
+SetFmtAttr( rNew );
+}
+
 SwTableBoxFmt::SwTableBoxFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
diff --git a/sw/source/core/docnode/ndtbl.cxx b/sw/source/core/docnode/ndtbl.cxx
index f8b224f..1f556c3 100644
--- a/sw/source/core/docnode/ndtbl.cxx
+++ b/sw/source/core/docnode/ndtbl.cxx
@@ -389,8 +389,11 @@ const SwTable* SwDoc::InsertTable( const 
SwInsertTableOptions rInsTblOpts,
 bCalledFromShell ? pCntntNd-GetSwAttrSet() : 0 );
 
 // Create the Box/Line/Table construct
-SwTableLineFmt* pLineFmt

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 3 commits - sw/inc sw/source

2013-07-04 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |   26 ++-
 sw/inc/tblafmt.hxx  |  134 --
 sw/source/core/bastyp/init.cxx  |3 
 sw/source/core/doc/swtblfmt.cxx |  115 +++
 sw/source/core/doc/tblafmt.cxx  |  293 
 sw/source/ui/table/tautofmt.cxx |   11 -
 6 files changed, 177 insertions(+), 405 deletions(-)

New commits:
commit 6668e83e1341112872c8e7f376534c6c76aac514
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Jul 4 14:01:17 2013 +0300

Remove SwAutoBoxFmt class from implementation

SwAutoBoxFmt class has been completely removed from the
current implementation. All the functionality has been moved
to SwTableBoxFmt.

Change-Id: I4d4486a7819c125cf5ef6785eb4af39fff3cf145

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 98f2132..a1e59b3 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -63,124 +63,6 @@ struct SwAfVersions;
 
 class SvNumberFormatter;
 
-class SwBoxAutoFmt
-{
-// common attributes of Calc and Writer
-// --- from 641 on: CJK and CTL font settings
-SvxFontItem aFont;
-SvxFontHeightItem   aHeight;
-SvxWeightItem   aWeight;
-SvxPostureItem  aPosture;
-
-SvxFontItem aCJKFont;
-SvxFontHeightItem   aCJKHeight;
-SvxWeightItem   aCJKWeight;
-SvxPostureItem  aCJKPosture;
-
-SvxFontItem aCTLFont;
-SvxFontHeightItem   aCTLHeight;
-SvxWeightItem   aCTLWeight;
-SvxPostureItem  aCTLPosture;
-
-SvxUnderlineItemaUnderline;
-SvxOverlineItem aOverline;
-SvxCrossedOutItem   aCrossedOut;
-SvxContourItem  aContour;
-SvxShadowedItem aShadowed;
-SvxColorItemaColor;
-SvxBoxItem  aBox;
-SvxLineItem aTLBR;
-SvxLineItem aBLTR;
-SvxBrushItemaBackground;
-
-// Writer specific
-SvxAdjustItem   aAdjust;
-SvxFrameDirectionItem m_aTextOrientation;
-SwFmtVertOrient m_aVerticalAlignment;
-
-// Calc specific
-SvxHorJustifyItem   aHorJustify;
-SvxVerJustifyItem   aVerJustify;
-SfxBoolItem aStacked;
-SvxMarginItem   aMargin;
-SfxBoolItem aLinebreak;
-SfxInt32ItemaRotateAngle;
-SvxRotateModeItem   aRotateMode;
-
-// number format
-String  sNumFmtString;
-LanguageTypeeSysLanguage, eNumFmtLanguage;
-
-public:
-SwBoxAutoFmt();
-SwBoxAutoFmt( const SwBoxAutoFmt rNew );
-~SwBoxAutoFmt();
-
-int operator==( const SwBoxAutoFmt rCmp ) const;
-SwBoxAutoFmt operator=( const SwBoxAutoFmt rNew );
-
-// The get-methods.
-const SvxFontItem   GetFont() const{ return aFont; }
-const SvxFontHeightItem GetHeight() const  { return aHeight; }
-const SvxWeightItem GetWeight() const  { return aWeight; }
-const SvxPostureItemGetPosture() const { return aPosture; }
-const SvxFontItem   GetCJKFont() const { return aCJKFont; }
-const SvxFontHeightItem GetCJKHeight() const   { return aCJKHeight; }
-const SvxWeightItem GetCJKWeight() const   { return aCJKWeight; }
-const SvxPostureItemGetCJKPosture() const  { return aCJKPosture; }
-const SvxFontItem   GetCTLFont() const { return aCTLFont; }
-const SvxFontHeightItem GetCTLHeight() const   { return aCTLHeight; }
-const SvxWeightItem GetCTLWeight() const   { return aCTLWeight; }
-const SvxPostureItemGetCTLPosture() const  { return aCTLPosture; }
-const SvxUnderlineItem  GetUnderline() const   { return aUnderline; }
-const SvxOverlineItem   GetOverline() const{ return aOverline; }
-const SvxCrossedOutItem GetCrossedOut() const  { return aCrossedOut; }
-const SvxContourItemGetContour() const { return aContour; }
-const SvxShadowedItem   GetShadowed() const{ return aShadowed; }
-const SvxColorItem  GetColor() const   { return aColor; }
-const SvxAdjustItem GetAdjust() const  { return aAdjust; }
-const SvxFrameDirectionItem GetTextOrientation() const { return 
m_aTextOrientation; }
-const SwFmtVertOrient GetVerticalAlignment() const { return 
m_aVerticalAlignment; }
-const SvxBoxItemGetBox() const { return aBox; }
-const SvxLineItem   GetTLBR() const{ return aTLBR; }
-const SvxLineItem   GetBLTR() const{ return aBLTR; }
-const SvxBrushItem  GetBackground() const  { return aBackground; }
-void GetValueFormat( String rFmt, LanguageType rLng, LanguageType rSys 
) const
-{ rFmt = sNumFmtString; rLng = eNumFmtLanguage; rSys = eSysLanguage; }
-
-// The set-methods.
-void SetFont( const SvxFontItem rNew ) { aFont = rNew; }
-void SetHeight( const SvxFontHeightItem rNew ) { aHeight = rNew; }
-void SetWeight( const SvxWeightItem rNew ) { aWeight = rNew; }
-void SetPosture( const

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-07-04 Thread Alex Ivan
 sw/inc/swtblfmt.hxx|2 
 sw/source/core/doc/tblafmt.cxx |  101 ++---
 2 files changed, 57 insertions(+), 46 deletions(-)

New commits:
commit 3190a43ec77fc818f7c426743aed443ec08a9ce5
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Jul 4 18:08:46 2013 +0300

Add Load function to SwTableFmt

Added a Load function to SwTableFmt to take over
part of the functionality of the one in SwTableAutoFmt.

Change-Id: I58fbe24e2d1914d2c89b2f86bb5b5fadc786b76c

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 71b32d1..d49396a 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -126,6 +126,8 @@ public:
 
 void CopyTableFormatInfo( const SwTableFmt* pTableFormat );
 
+sal_Bool Load( SvStream rStream, const SwAfVersions rVersions, SwDoc* 
pDoc, sal_uInt16 nVal );
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 14e55b6..7a09fa1 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -716,6 +716,60 @@ void SwTableAutoFmt::StoreTableProperties(const SwTable 
table)
 m_pTableStyle-StoreTableProperties( table );
 }
 
+sal_Bool SwTableFmt::Load( SvStream rStream, const SwAfVersions rVersions, 
SwDoc* pDoc, sal_uInt16 nVal )
+{
+sal_Bool bRet = 0 == rStream.GetError();
+
+if (nVal = AUTOFORMAT_DATA_ID_31005  WriterSpecificBlockExists(rStream))
+{
+SfxPoolItem* pNew = 0;
+
+SvxFmtBreakItem aBreak = SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK );
+READ( aBreak, SvxFmtBreakItem, AUTOFORMAT_FILE_VERSION );
+SetBreak( aBreak );
+
+SwFmtPageDesc aPageDesc;
+READ( aPageDesc, SwFmtPageDesc, AUTOFORMAT_FILE_VERSION );
+SetPageDesc( aPageDesc );
+
+SvxFmtKeepItem aKeepWithNextPara = SvxFmtKeepItem( sal_False, RES_KEEP 
);
+READ( aKeepWithNextPara, SvxFmtKeepItem, AUTOFORMAT_FILE_VERSION );
+SetKeepWithNextPara( aKeepWithNextPara );
+
+sal_uInt16 aRepeatHeading;
+sal_Bool bLayoutSplit;
+sal_Bool bRowSplit;
+sal_Bool bCollapsingBorders;
+rStream  aRepeatHeading  bLayoutSplit  bRowSplit  
bCollapsingBorders;
+SetRepeatHeading( aRepeatHeading );
+SetRowSplit( bRowSplit );
+SetLayoutSplit( bLayoutSplit );
+SetCollapsingBorders( bCollapsingBorders );
+
+SvxShadowItem aShadow = SvxShadowItem( RES_SHADOW );
+READ( aShadow, SvxShadowItem, AUTOFORMAT_FILE_VERSION );
+SetShadow( aShadow );
+}
+
+bRet = 0 == rStream.GetError();
+
+for( sal_uInt8 i = 0; bRet  i  16; ++i )
+{
+SwTableBoxFmt* pFmt = pDoc-MakeTableBoxFmt();
+
+bRet = pFmt-Load( rStream, rVersions, nVal );
+if( bRet )
+SetBoxFmt( *pFmt, i );
+else
+{
+delete pFmt;
+break;
+}
+}
+
+return bRet;
+}
+
 SwTableAutoFmt* SwTableAutoFmt::Load( SvStream rStream, const SwAfVersions 
rVersions, SwDoc* pDoc )
 {
 SwTableAutoFmt* pRet = NULL;
@@ -761,52 +815,7 @@ SwTableAutoFmt* SwTableAutoFmt::Load( SvStream rStream, 
const SwAfVersions rVe
 rStream  b; pRet-bInclValueFormat = b;
 rStream  b; pRet-bInclWidthHeight = b;
 
-if (nVal = AUTOFORMAT_DATA_ID_31005  
WriterSpecificBlockExists(rStream))
-{
-SfxPoolItem* pNew = 0;
-
-SvxFmtBreakItem m_aBreak = SvxFmtBreakItem( SVX_BREAK_NONE, 
RES_BREAK );
-READ(m_aBreak, SvxFmtBreakItem, AUTOFORMAT_FILE_VERSION);
-pStyle-SetBreak( m_aBreak );
-
-SwFmtPageDesc m_aPageDesc;
-READ(m_aPageDesc, SwFmtPageDesc, AUTOFORMAT_FILE_VERSION);
-pStyle-SetPageDesc( m_aPageDesc );
-
-SvxFmtKeepItem m_aKeepWithNextPara = SvxFmtKeepItem( sal_False, 
RES_KEEP );
-READ(m_aKeepWithNextPara, SvxFmtKeepItem, AUTOFORMAT_FILE_VERSION);
-pStyle-SetKeepWithNextPara( m_aKeepWithNextPara );
-
-sal_uInt16 m_aRepeatHeading;
-sal_Bool m_bLayoutSplit;
-sal_Bool m_bRowSplit;
-sal_Bool m_bCollapsingBorders;
-rStream  m_aRepeatHeading  m_bLayoutSplit  m_bRowSplit  
m_bCollapsingBorders;
-pStyle-SetRepeatHeading( m_aRepeatHeading );
-pStyle-SetRowSplit( m_bRowSplit );
-pStyle-SetLayoutSplit( m_bLayoutSplit );
-pStyle-SetCollapsingBorders( m_bCollapsingBorders );
-
-SvxShadowItem m_aShadow = SvxShadowItem( RES_SHADOW );
-READ(m_aShadow, SvxShadowItem, AUTOFORMAT_FILE_VERSION);
-pStyle-SetShadow( m_aShadow );
-}
-
-bRet = 0 == rStream.GetError();
-
-for( sal_uInt8 i = 0; bRet  i  16; ++i )
-{
-SwTableBoxFmt* pFmt = pDoc-MakeTableBoxFmt();
-
-bRet = pFmt-Load( rStream, rVersions, nVal

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/inc sw/source

2013-06-30 Thread Alex Ivan
 sw/inc/charatr.hxx  |   12 +
 sw/inc/swtblfmt.hxx |   87 +++--
 sw/inc/tblafmt.hxx  |4 
 sw/source/core/doc/swtblfmt.cxx |  139 -
 sw/source/core/doc/tblafmt.cxx  |  261 
 5 files changed, 298 insertions(+), 205 deletions(-)

New commits:
commit f85cc2130c35f22e998e031324d0162367f4d0f8
Author: Alex Ivan alexni...@yahoo.com
Date:   Sun Jun 30 23:10:21 2013 +0300

Save/Load of SwBoxAutoFmt move to SwTableBoxFmt

Save and Load methods have been moved to SwTableBoxFmt.
Should now be safe to begin removing Sw*AutoFmt.

Change-Id: I3bca20af4fb540f2923e17d2a1c115f39097b44d

diff --git a/sw/inc/charatr.hxx b/sw/inc/charatr.hxx
index 886437a..f302047 100644
--- a/sw/inc/charatr.hxx
+++ b/sw/inc/charatr.hxx
@@ -104,8 +104,16 @@ inline const SvxCharHiddenItem  SwAttrSet::GetCharHidden( 
sal_Bool bInP ) const
 
 inline const SvxPostureItem  SwFmt::GetPosture(sal_Bool bInP) const
 {   return aSet.GetPosture(bInP); }
+inline const SvxPostureItem  SwFmt::GetCJKPosture(sal_Bool bInP) const
+{   return aSet.GetCJKPosture(bInP); }
+inline const SvxPostureItem  SwFmt::GetCTLPosture(sal_Bool bInP) const
+{   return aSet.GetCTLPosture(bInP); }
 inline const SvxWeightItem   SwFmt::GetWeight(sal_Bool bInP) const
 {   return aSet.GetWeight(bInP); }
+inline const SvxWeightItem   SwFmt::GetCJKWeight(sal_Bool bInP) const
+{   return aSet.GetCJKWeight(bInP); }
+inline const SvxWeightItem   SwFmt::GetCTLWeight(sal_Bool bInP) const
+{   return aSet.GetCTLWeight(bInP); }
 inline const SvxShadowedItem SwFmt::GetShadowed(sal_Bool bInP) const
 {   return aSet.GetShadowed(bInP); }
 inline const SvxAutoKernItem SwFmt::GetAutoKern(sal_Bool bInP) const
@@ -124,6 +132,10 @@ inline const SvxCrossedOutItem   
SwFmt::GetCrossedOut(sal_Bool bInP) const
 {   return aSet.GetCrossedOut(bInP); }
 inline const SvxFontHeightItem SwFmt::GetSize(sal_Bool bInP) const
 {   return aSet.GetSize(bInP); }
+inline const SvxFontHeightItem SwFmt::GetCJKSize(sal_Bool bInP) 
const
+{   return aSet.GetCJKSize(bInP); }
+inline const SvxFontHeightItem SwFmt::GetCTLSize(sal_Bool bInP) 
const
+{   return aSet.GetCTLSize(bInP); }
 inline const SvxPropSizeItem SwFmt::GetPropSize(sal_Bool bInP) const
 {   return aSet.GetPropSize(bInP); }
 inline const SvxFontItem SwFmt::GetFont(sal_Bool bInP) const
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 6227ecc..990032f 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -50,6 +50,8 @@
 #include frmfmt.hxx
 #include paratr.hxx
 
+struct SwAfVersions;
+
 class SwDoc;
 class SwTableLineFmt;
 class SwTableBoxFmt;
@@ -204,11 +206,19 @@ public:
 
 void SetValueFormat( const String rFmt, LanguageType eLng, LanguageType 
eSys );
 
+const SvxFontHeightItem GetHeight() const;
+const SvxFontHeightItem GetCJKHeight() const;
+const SvxFontHeightItem GetCTLHeight() const;
+
 const SvxFrameDirectionItem GetTextOrientation() const;
 const SwFmtVertOrient GetVerticalAlignment() const;
 
 void GetValueFormat( String rFmt, LanguageType rLng, LanguageType rSys 
) const;
 
+sal_Bool Load( SvStream rStream, const SwAfVersions rVersions, 
sal_uInt16 nVer );
+sal_Bool Save( SvStream rStream, sal_uInt16 fileVersion ) const;
+sal_Bool SaveVersionNo( SvStream rStream, sal_uInt16 fileVersion ) const;
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 3ac0123..d8f3132 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -178,10 +178,6 @@ public:
 void SetBackground( const SvxBrushItem rNew )  { aBackground = rNew; }
 void SetValueFormat( const String rFmt, LanguageType eLng, LanguageType 
eSys )
 { sNumFmtString = rFmt; eNumFmtLanguage = eLng; eSysLanguage = eSys; }
-
-sal_Bool Load( SvStream rStream, const SwAfVersions rVersions, 
sal_uInt16 nVer );
-sal_Bool Save( SvStream rStream, sal_uInt16 fileVersion ) const;
-sal_Bool SaveVersionNo( SvStream rStream, sal_uInt16 fileVersion ) const;
 };
 
 /*
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index d9d9c7e..65bdb5f 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -427,6 +427,21 @@ void SwTableBoxFmt::SetValueFormat( const String rFmt, 
LanguageType eLng, Langu
 eSysLanguage = eSys;
 }
 
+const SvxFontHeightItem SwTableBoxFmt::GetHeight() const
+{
+return SwFmt::GetSize();
+}
+
+const SvxFontHeightItem SwTableBoxFmt::GetCJKHeight() const
+{
+return SwFmt::GetCJKSize();
+}
+
+const SvxFontHeightItem SwTableBoxFmt::GetCTLHeight() const
+{
+return SwFmt::GetCTLSize();
+}
+
 const SvxFrameDirectionItem SwTableBoxFmt

[Libreoffice-commits] core.git: Branch 'feature/table-style' - 2 commits - sw/inc sw/source

2013-06-29 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |   81 ++--
 sw/source/core/doc/swtblfmt.cxx |  115 
 sw/source/core/doc/tblafmt.cxx  |2 
 3 files changed, 127 insertions(+), 71 deletions(-)

New commits:
commit 3e253b6cf39256135eaab39e66cf495764576702
Author: Alex Ivan alexni...@yahoo.com
Date:   Sat Jun 29 20:21:07 2013 +0300

Store/RestoreTableProperties handle components

Methods now also store/apply information regarding
the format of components.

Change-Id: Id6b1b255974e593f373e43972214e451f5ba7047

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 16fc373..3f25f7a 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -75,6 +75,7 @@ protected:
 SwTableLineFmt* m_pEvnColFmt;
 
 public:
+SwTableFmt( SwTableFmt rNew );
 SwTableFmt operator=( const SwTableFmt rNew );
 
 void SetFirstLineFmt( SwTableLineFmt* pNew ) { m_pFstLineFmt = pNew; }
@@ -112,6 +113,8 @@ public:
 sal_Bool GetRowSplit() const;
 sal_uInt16 GetRepeatHeading() const;
 
+void CopyTableFormatInfo( SwTableFmt* pTableFormat );
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
@@ -135,6 +138,8 @@ protected:
 SwTableBoxFmt* m_pEvnBoxFmt;
 
 public:
+SwTableLineFmt( SwTableLineFmt rNew );
+SwTableLineFmt operator=( const SwTableLineFmt rNew );
 
 void SetFirstBoxFmt( SwTableBoxFmt* pNew ) { m_pFstBoxFmt = pNew; }
 void SetLastBoxFmt( SwTableBoxFmt* pNew ) { m_pLstBoxFmt = pNew; }
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 7d0bbe3..d31b8e2 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -69,6 +69,20 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const String 
rFmtNm,
 m_pEvnColFmt = pDoc-MakeTableLineFmt();
 }
 
+SwTableFmt::SwTableFmt( SwTableFmt rNew )
+: SwFrmFmt( (SwFrmFmt)rNew )
+{
+*m_pFstLineFmt = SwTableLineFmt( *rNew.GetFirstLineFmt() );
+*m_pLstLineFmt = SwTableLineFmt( *rNew.GetLastLineFmt() );
+*m_pOddLineFmt = SwTableLineFmt( *rNew.GetOddLineFmt() );
+*m_pEvnLineFmt = SwTableLineFmt( *rNew.GetEvenLineFmt() );
+
+*m_pFstColFmt = SwTableLineFmt( *rNew.GetFirstColFmt() );
+*m_pLstColFmt = SwTableLineFmt( *rNew.GetLastColFmt() );
+*m_pOddColFmt = SwTableLineFmt( *rNew.GetOddColFmt() );
+*m_pEvnColFmt = SwTableLineFmt( *rNew.GetEvenColFmt() );
+}
+
 SwTableFmt SwTableFmt::operator=( const SwTableFmt rNew )
 {
 if (rNew == this)
@@ -152,6 +166,19 @@ sal_uInt16 SwTableFmt::GetRepeatHeading() const
 return (static_castconst SfxUInt16Item( GetFmtAttr( 
FN_PARAM_TABLE_HEADLINE ) )).GetValue();
 }
 
+void SwTableFmt::CopyTableFormatInfo( SwTableFmt* pTableFormat )
+{
+*m_pFstLineFmt = SwTableLineFmt ( *pTableFormat-GetFirstLineFmt() );
+*m_pLstLineFmt = SwTableLineFmt ( *pTableFormat-GetLastLineFmt() );
+*m_pOddLineFmt = SwTableLineFmt ( *pTableFormat-GetOddLineFmt() );
+*m_pEvnLineFmt = SwTableLineFmt ( *pTableFormat-GetEvenLineFmt() );
+
+*m_pFstColFmt = SwTableLineFmt ( *pTableFormat-GetFirstColFmt() );
+*m_pLstColFmt = SwTableLineFmt ( *pTableFormat-GetLastColFmt() );
+*m_pOddColFmt = SwTableLineFmt ( *pTableFormat-GetOddColFmt() );
+*m_pEvnColFmt = SwTableLineFmt ( *pTableFormat-GetEvenColFmt() );
+}
+
 SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
@@ -176,6 +203,28 @@ SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const 
String rFmtNm,
 m_pEvnBoxFmt = pDoc-MakeTableBoxFmt();
 }
 
+SwTableLineFmt::SwTableLineFmt( SwTableLineFmt rNew )
+: SwFrmFmt( (SwFrmFmt)rNew )
+{
+*m_pFstBoxFmt = SwTableBoxFmt( *rNew.GetFirstBoxFmt() );
+*m_pLstBoxFmt = SwTableBoxFmt( *rNew.GetLastBoxFmt() );
+*m_pOddBoxFmt = SwTableBoxFmt( *rNew.GetOddBoxFmt() );
+*m_pEvnBoxFmt = SwTableBoxFmt( *rNew.GetEvenBoxFmt() );
+}
+
+SwTableLineFmt SwTableLineFmt::operator=( const SwTableLineFmt rNew )
+{
+if (rNew == this)
+return *this;
+
+m_pFstBoxFmt = rNew.m_pFstBoxFmt;
+m_pLstBoxFmt = rNew.m_pLstBoxFmt;
+m_pOddBoxFmt = rNew.m_pOddBoxFmt;
+m_pEvnBoxFmt = rNew.m_pEvnBoxFmt;
+
+return *this;
+}
+
 SwTableBoxFmt::SwTableBoxFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index abbddbc..baa170a 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -850,6 +850,7 @@ void SwTableAutoFmt::RestoreTableProperties(SwTable table) 
const
 return;
 
 pFormat-SetFmtAttr

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-06-28 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |   30 +-
 sw/source/core/doc/swtblfmt.cxx |   31 ---
 2 files changed, 45 insertions(+), 16 deletions(-)

New commits:
commit d418934c49ca39638898503895762fca69ba64c1
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Jun 28 13:44:54 2013 +0300

Store RowSplit and RepeatHeading in item pool

Removed m_aRepeatHeading and m_bRowSplit members from SwTableFmt.
Now stored in SfxItemPool.

Change-Id: I83f46ee38ce01db5dfae02e821d8e0a902a9cfc0

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index ef66a10..7783f7ba 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -19,11 +19,28 @@
 #ifndef _SWTBLFMT_HXX
 #define _SWTBLFMT_HXX
 
+#include cmdid.h
+#include editeng/fontitem.hxx
+#include editeng/fhgtitem.hxx
+#include editeng/wghtitem.hxx
+#include editeng/postitem.hxx
+#include editeng/udlnitem.hxx
+#include editeng/crossedoutitem.hxx
+#include editeng/contouritem.hxx
+#include editeng/shdditem.hxx
+#include editeng/colritem.hxx
+#include editeng/boxitem.hxx
+#include editeng/brushitem.hxx
+#include editeng/adjustitem.hxx
+#include editeng/justifyitem.hxx
 #include editeng/formatbreakitem.hxx
 #include editeng/keepitem.hxx
+#include editeng/lineitem.hxx
+#include editeng/frmdiritem.hxx
 #include editeng/shaditem.hxx
 #include fmtpdsc.hxx
 #include fmtlsplt.hxx
+#include fmtrowsplt.hxx
 #include frmatr.hxx
 #include frmfmt.hxx
 
@@ -52,9 +69,6 @@ protected:
 SwTableLineFmt* pOddColFmt;
 SwTableLineFmt* pEvnColFmt;
 
-sal_uInt16 m_aRepeatHeading;
-sal_Bool m_bRowSplit;
-
 public:
 SwTableFmt operator=( const SwTableFmt rNew );
 
@@ -78,22 +92,20 @@ public:
 SwTableLineFmt* GetOddColFmt() { return pOddColFmt; }
 SwTableLineFmt* GetEvenColFmt() { return pEvnColFmt; }
 
-void SetRepeatHeading( const sal_uInt16 rNew ) { m_aRepeatHeading = rNew; 
}
-void SetRowSplit( const sal_Bool rNew ) { m_bRowSplit = rNew; }
-
-const sal_uInt16 GetRepeatHeading() const { return m_aRepeatHeading; }
-const sal_Bool GetRowSplit() const { return m_bRowSplit; }
-
 void SetBreak( const SvxFmtBreakItem rNew );
 void SetPageDesc( const SwFmtPageDesc rNew );
 void SetKeepWithNextPara( const SvxFmtKeepItem rNew );
 void SetLayoutSplit( const sal_Bool rNew );
 void SetCollapsingBorders( const sal_Bool rNew );
+void SetRowSplit( const sal_Bool rNew );
+void SetRepeatHeading( const sal_uInt16 rNew );
 void SetShadow( const SvxShadowItem rNew );
 
 const SvxFmtKeepItem GetKeepWithNextPara() const;
 sal_Bool GetLayoutSplit() const;
 sal_Bool GetCollapsingBorders() const;
+sal_Bool GetRowSplit() const;
+sal_uInt16 GetRepeatHeading() const;
 
 TYPEINFO(); // Already in base class Content.
 
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index 3421db4..a14b961 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -22,13 +22,13 @@
 SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-, m_aRepeatHeading( 0 )
-, m_bRowSplit( sal_True )
 {
 SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
 SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
 SetLayoutSplit( sal_True );
 SetCollapsingBorders( sal_True );
+SetRowSplit( sal_True );
+SetRepeatHeading( 0 );
 SetShadow( SvxShadowItem( RES_SHADOW ) );
 
 pFstLineFmt = NULL;
@@ -45,13 +45,13 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* 
pFmtNm,
 SwTableFmt::SwTableFmt( SwAttrPool rPool, const String rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-, m_aRepeatHeading( 0 )
-, m_bRowSplit( sal_True )
 {
 SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
 SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
 SetLayoutSplit( sal_True );
 SetCollapsingBorders( sal_True );
+SetRowSplit( sal_True );
+SetRepeatHeading( 0 );
 SetShadow( SvxShadowItem( RES_SHADOW ) );
 
 pFstLineFmt = NULL;
@@ -70,9 +70,6 @@ SwTableFmt SwTableFmt::operator=( const SwTableFmt rNew )
 if (rNew == this)
 return *this;
 
-m_aRepeatHeading = rNew.m_aRepeatHeading;
-m_bRowSplit = rNew.m_bRowSplit;
-
 pFstLineFmt = rNew.pFstLineFmt;
 pLstLineFmt = rNew.pLstLineFmt;
 pOddLineFmt = rNew.pOddLineFmt;
@@ -111,6 +108,16 @@ void SwTableFmt::SetCollapsingBorders( const sal_Bool 
rNew )
 SetFmtAttr( SfxBoolItem( RES_COLLAPSING_BORDERS, rNew ) );
 }
 
+void SwTableFmt::SetRowSplit( const sal_Bool rNew )
+{
+SetFmtAttr( SwFmtRowSplit( rNew ) );
+}
+
+void SwTableFmt::SetRepeatHeading( const

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-06-28 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |   50 -
 sw/source/core/doc/swtblfmt.cxx |  215 
 2 files changed, 259 insertions(+), 6 deletions(-)

New commits:
commit 61a362510e0632b0b764dc02fb6242874b15418c
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Jun 28 18:56:54 2013 +0300

Add cell format info into SwTableBoxFmt

Migrated cell format information into SwTableBoxFmt.
Will remove info from SwTableBoxAutoFmt and try to remove the
class entirely as progress is made.

Change-Id: I4d5d0bc19aa80dfd1f8157eb0c05d54695cd9c8e

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 7783f7ba..e3f7e9f 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -19,6 +19,8 @@
 #ifndef _SWTBLFMT_HXX
 #define _SWTBLFMT_HXX
 
+#include hintids.hxx
+#include charatr.hxx
 #include cmdid.h
 #include editeng/fontitem.hxx
 #include editeng/fhgtitem.hxx
@@ -40,9 +42,11 @@
 #include editeng/shaditem.hxx
 #include fmtpdsc.hxx
 #include fmtlsplt.hxx
+#include fmtornt.hxx
 #include fmtrowsplt.hxx
 #include frmatr.hxx
 #include frmfmt.hxx
+#include paratr.hxx
 
 class SwDoc;
 class SwTableLineFmt;
@@ -150,20 +154,54 @@ class SW_DLLPUBLIC SwTableBoxFmt : public SwFrmFmt
 {
 friend class SwDoc;
 
+String  sNumFmtString;
+LanguageTypeeSysLanguage, eNumFmtLanguage;
+
 protected:
 SwTableBoxFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
-SwFrmFmt *pDrvdFrm )
-: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
-{}
+SwFrmFmt *pDrvdFrm );
 SwTableBoxFmt( SwAttrPool rPool, const String rFmtNm,
-SwFrmFmt *pDrvdFrm )
-: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
-{}
+SwFrmFmt *pDrvdFrm );
 
// For recognition of changes (especially TableBoxAttribute).
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNewValue 
);
 
 public:
+void SetFont( const SvxFontItem rNew );
+void SetHeight( const SvxFontHeightItem rNew );
+void SetWeight( const SvxWeightItem rNew );
+void SetPosture( const SvxPostureItem rNew );
+
+void SetCJKFont( const SvxFontItem rNew );
+void SetCJKHeight( const SvxFontHeightItem rNew );
+void SetCJKWeight( const SvxWeightItem rNew );
+void SetCJKPosture( const SvxPostureItem rNew );
+
+void SetCTLFont( const SvxFontItem rNew );
+void SetCTLHeight( const SvxFontHeightItem rNew );
+void SetCTLWeight( const SvxWeightItem rNew );
+void SetCTLPosture( const SvxPostureItem rNew );
+
+void SetUnderline( const SvxUnderlineItem rNew );
+void SetOverline( const SvxOverlineItem rNew );
+void SetCrossedOut( const SvxCrossedOutItem rNew );
+void SetContour( const SvxContourItem rNew );
+void SetShadowed( const SvxShadowedItem rNew );
+void SetColor( const SvxColorItem rNew );
+void SetBox( const SvxBoxItem rNew );
+void SetBackground( const SvxBrushItem rNew );
+
+void SetAdjust( const SvxAdjustItem rNew );
+void SetTextOrientation( const SvxFrameDirectionItem rNew );
+void SetVerticalAlignment( const SwFmtVertOrient rNew );
+
+void SetValueFormat( const String rFmt, LanguageType eLng, LanguageType 
eSys );
+
+const SvxFrameDirectionItem GetTextOrientation() const;
+const SwFmtVertOrient GetVerticalAlignment() const;
+
+void GetValueFormat( String rFmt, LanguageType rLng, LanguageType rSys 
) const;
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableBoxFmt)
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index a14b961..b5d387f 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -168,4 +168,219 @@ SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const 
String rFmtNm,
 pEvnBoxFmt = NULL;
 }
 
+SwTableBoxFmt::SwTableBoxFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
+SwFrmFmt *pDrvdFrm )
+: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableBoxSetRange )
+{
+SetFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_FONT ) );
+SetHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_FONTSIZE) );
+SetWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_WEIGHT ) );
+SetPosture( SvxPostureItem( ITALIC_NONE, RES_CHRATR_POSTURE ) );
+
+SetCJKFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_CJK_FONT ) );
+SetCJKHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_CJK_FONTSIZE) );
+SetCJKWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CJK_WEIGHT ) );
+SetCJKPosture( SvxPostureItem( ITALIC_NONE, RES_CHRATR_CJK_POSTURE ) );
+
+SetCTLFont( *(SvxFontItem*)GetDfltAttr( RES_CHRATR_CTL_FONT ) );
+SetCTLHeight( SvxFontHeightItem( 240, 100, RES_CHRATR_CTL_FONTSIZE) );
+SetCTLWeight( SvxWeightItem( WEIGHT_NORMAL, RES_CHRATR_CTL_WEIGHT ) );
+SetCTLPosture

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-06-28 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |1 
 sw/source/core/doc/swtblfmt.cxx |   58 ++--
 2 files changed, 34 insertions(+), 25 deletions(-)

New commits:
commit 2ff314df35dbcc0ae0cfdd76cba53155db9b2764
Author: Alex Ivan alexni...@yahoo.com
Date:   Fri Jun 28 19:46:02 2013 +0300

Proper initilization of members in SwTable*Fmt

Modified initilization of members in SwTableFmt and SwTableLineFmt
in order to properly create formats for lines and, respectively, boxes.

Change-Id: I5e7e1a57b6745ac60a8167b3e0968202657fb4ef

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index e3f7e9f..cbbed13 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -22,6 +22,7 @@
 #include hintids.hxx
 #include charatr.hxx
 #include cmdid.h
+#include doc.hxx
 #include editeng/fontitem.hxx
 #include editeng/fhgtitem.hxx
 #include editeng/wghtitem.hxx
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index b5d387f..d7b5e1c 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -31,15 +31,17 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* 
pFmtNm,
 SetRepeatHeading( 0 );
 SetShadow( SvxShadowItem( RES_SHADOW ) );
 
-pFstLineFmt = NULL;
-pLstLineFmt = NULL;
-pOddLineFmt = NULL;
-pEvnLineFmt = NULL;
-
-pFstColFmt = NULL;
-pLstColFmt = NULL;
-pOddColFmt = NULL;
-pEvnColFmt = NULL;
+SwDoc* pDoc = GetDoc();
+
+pFstLineFmt = pDoc-MakeTableLineFmt();
+pLstLineFmt = pDoc-MakeTableLineFmt();
+pOddLineFmt = pDoc-MakeTableLineFmt();
+pEvnLineFmt = pDoc-MakeTableLineFmt();
+
+pFstColFmt = pDoc-MakeTableLineFmt();
+pLstColFmt = pDoc-MakeTableLineFmt();
+pOddColFmt = pDoc-MakeTableLineFmt();
+pEvnColFmt = pDoc-MakeTableLineFmt();
 }
 
 SwTableFmt::SwTableFmt( SwAttrPool rPool, const String rFmtNm,
@@ -54,15 +56,17 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const String 
rFmtNm,
 SetRepeatHeading( 0 );
 SetShadow( SvxShadowItem( RES_SHADOW ) );
 
-pFstLineFmt = NULL;
-pLstLineFmt = NULL;
-pOddLineFmt = NULL;
-pEvnLineFmt = NULL;
+SwDoc* pDoc = GetDoc();
+
+pFstLineFmt = pDoc-MakeTableLineFmt();
+pLstLineFmt = pDoc-MakeTableLineFmt();
+pOddLineFmt = pDoc-MakeTableLineFmt();
+pEvnLineFmt = pDoc-MakeTableLineFmt();
 
-pFstColFmt = NULL;
-pLstColFmt = NULL;
-pOddColFmt = NULL;
-pEvnColFmt = NULL;
+pFstColFmt = pDoc-MakeTableLineFmt();
+pLstColFmt = pDoc-MakeTableLineFmt();
+pOddColFmt = pDoc-MakeTableLineFmt();
+pEvnColFmt = pDoc-MakeTableLineFmt();
 }
 
 SwTableFmt SwTableFmt::operator=( const SwTableFmt rNew )
@@ -152,20 +156,24 @@ SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const 
sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
 {
-pFstBoxFmt = NULL;
-pLstBoxFmt = NULL;
-pOddBoxFmt = NULL;
-pEvnBoxFmt = NULL;
+SwDoc* pDoc = GetDoc();
+
+pFstBoxFmt = pDoc-MakeTableBoxFmt();
+pLstBoxFmt = pDoc-MakeTableBoxFmt();
+pOddBoxFmt = pDoc-MakeTableBoxFmt();
+pEvnBoxFmt = pDoc-MakeTableBoxFmt();
 }
 
 SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const String rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
 {
-pFstBoxFmt = NULL;
-pLstBoxFmt = NULL;
-pOddBoxFmt = NULL;
-pEvnBoxFmt = NULL;
+SwDoc* pDoc = GetDoc();
+
+pFstBoxFmt = pDoc-MakeTableBoxFmt();
+pLstBoxFmt = pDoc-MakeTableBoxFmt();
+pOddBoxFmt = pDoc-MakeTableBoxFmt();
+pEvnBoxFmt = pDoc-MakeTableBoxFmt();
 }
 
 SwTableBoxFmt::SwTableBoxFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/Library_sw.mk sw/source

2013-06-27 Thread Alex Ivan
 sw/Library_sw.mk|1 
 sw/inc/swtblfmt.hxx |   48 +++---
 sw/source/core/doc/swtblfmt.cxx |   72 
 3 files changed, 79 insertions(+), 42 deletions(-)

New commits:
commit 6d71db73a4dd814a8d80d00e640d4c1ff3611dbf
Author: Alex Ivan alexni...@yahoo.com
Date:   Wed Jun 26 12:51:27 2013 +0300

Move constructors from sw/inc/swtblfmt.hxx

Moved the constructors for SwTableFmt and SwTableLineFmt
from the header file for clarity.

Change-Id: If33d48feefcb712fe745c6d2c87e5bb3aa83d8cc

diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index 679d60d..c934b7e 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -195,6 +195,7 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
 sw/source/core/doc/sortopt \
 sw/source/core/doc/swserv \
 sw/source/core/doc/swstylemanager \
+sw/source/core/doc/swtblfmt \
 sw/source/core/doc/tblafmt \
 sw/source/core/doc/tblcpy \
 sw/source/core/doc/tblrwcl \
diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 76c6311..2a9d53a 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -31,33 +31,10 @@ class SW_DLLPUBLIC SwTableFmt : public SwFrmFmt
 
 protected:
 SwTableFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
-SwFrmFmt *pDrvdFrm )
-: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-{
-pFstLineFmt = NULL;
-pLstLineFmt = NULL;
-pOddLineFmt = NULL;
-pEvnLineFmt = NULL;
-
-pFstColFmt = NULL;
-pLstColFmt = NULL;
-pOddColFmt = NULL;
-pEvnColFmt = NULL;
-}
+SwFrmFmt *pDrvdFrm );
+
 SwTableFmt( SwAttrPool rPool, const String rFmtNm,
-SwFrmFmt *pDrvdFrm )
-: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-{
-pFstLineFmt = NULL;
-pLstLineFmt = NULL;
-pOddLineFmt = NULL;
-pEvnLineFmt = NULL;
-
-pFstColFmt = NULL;
-pLstColFmt = NULL;
-pOddColFmt = NULL;
-pEvnColFmt = NULL;
-}
+SwFrmFmt *pDrvdFrm );
 
 SwTableLineFmt* pFstLineFmt;
 SwTableLineFmt* pLstLineFmt;
@@ -102,23 +79,10 @@ class SwTableLineFmt : public SwFrmFmt
 
 protected:
 SwTableLineFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
-SwFrmFmt *pDrvdFrm )
-: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
-{
-pFstBoxFmt = NULL;
-pLstBoxFmt = NULL;
-pOddBoxFmt = NULL;
-pEvnBoxFmt = NULL;
-}
+SwFrmFmt *pDrvdFrm );
+
 SwTableLineFmt( SwAttrPool rPool, const String rFmtNm,
-SwFrmFmt *pDrvdFrm )
-: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
-{
-pFstBoxFmt = NULL;
-pLstBoxFmt = NULL;
-pOddBoxFmt = NULL;
-pEvnBoxFmt = NULL;
-}
+SwFrmFmt *pDrvdFrm );
 
 // Odd and Even Box formats will be used to handle alternating columns
 SwTableBoxFmt* pFstBoxFmt;
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
new file mode 100644
index 000..b3cd7ff
--- /dev/null
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -0,0 +1,72 @@
+/* -*- 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 swtblfmt.hxx
+
+SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
+SwFrmFmt *pDrvdFrm )
+: SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
+{
+pFstLineFmt = NULL;
+pLstLineFmt = NULL;
+pOddLineFmt = NULL;
+pEvnLineFmt = NULL;
+
+pFstColFmt = NULL;
+pLstColFmt = NULL;
+pOddColFmt = NULL;
+pEvnColFmt = NULL;
+}
+
+SwTableFmt::SwTableFmt( SwAttrPool rPool, const String rFmtNm,
+SwFrmFmt *pDrvdFrm )
+: SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
+{
+pFstLineFmt = NULL;
+pLstLineFmt = NULL;
+pOddLineFmt = NULL;
+pEvnLineFmt = NULL

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-06-27 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |   29 +++
 sw/inc/tblafmt.hxx  |   12 
 sw/source/core/doc/swtblfmt.cxx |   97 
 sw/source/core/doc/tblafmt.cxx  |   93 +-
 4 files changed, 170 insertions(+), 61 deletions(-)

New commits:
commit 171093a390fb2c29cee610fd0f6924b3c0a351fd
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Jun 27 15:28:29 2013 +0300

Move table format information into SwTableFmt

Moved the information currently stored in SwTableAutoFmt
into SwTableFmt class

Change-Id: If0d0cf82a2ea14995410bcf03957d9a85b6e8e17

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index 2a9d53a..a068fb9 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -19,6 +19,11 @@
 #ifndef _SWTBLFMT_HXX
 #define _SWTBLFMT_HXX
 
+#include editeng/formatbreakitem.hxx
+#include editeng/keepitem.hxx
+#include editeng/shaditem.hxx
+#include fmtpdsc.hxx
+#include fmtlsplt.hxx
 #include frmfmt.hxx
 
 class SwDoc;
@@ -46,7 +51,11 @@ protected:
 SwTableLineFmt* pOddColFmt;
 SwTableLineFmt* pEvnColFmt;
 
+sal_uInt16 m_aRepeatHeading;
+sal_Bool m_bRowSplit;
+
 public:
+SwTableFmt operator=( const SwTableFmt rNew );
 
 void SetFirstLineFmt( SwTableLineFmt* pNew ) { pFstLineFmt = pNew; }
 void SetLastLineFmt( SwTableLineFmt* pNew ) { pLstLineFmt = pNew; }
@@ -68,6 +77,26 @@ public:
 SwTableLineFmt* GetOddColFmt() { return pOddColFmt; }
 SwTableLineFmt* GetEvenColFmt() { return pEvnColFmt; }
 
+void SetRepeatHeading( const sal_uInt16 rNew ) { m_aRepeatHeading = rNew; 
}
+void SetRowSplit( const sal_Bool rNew ) { m_bRowSplit = rNew; }
+
+const sal_uInt16 GetRepeatHeading() const { return m_aRepeatHeading; }
+const sal_Bool GetRowSplit() const { return m_bRowSplit; }
+
+void SetBreak( const SvxFmtBreakItem rNew );
+void SetPageDesc( const SwFmtPageDesc rNew );
+void SetKeepWithNextPara( const SvxFmtKeepItem rNew );
+void SetLayoutSplit( const sal_Bool rNew );
+void SetCollapsingBorders( const sal_Bool rNew );
+void SetShadow( const SvxShadowItem rNew );
+
+const SvxFmtBreakItem GetBreak() const;
+const SwFmtPageDesc GetPageDesc() const;
+const SvxFmtKeepItem GetKeepWithNextPara() const;
+sal_Bool GetLayoutSplit() const;
+sal_Bool GetCollapsingBorders() const;
+const SvxShadowItem GetShadow() const;
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 1988933..3ac0123 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -249,16 +249,6 @@ class SW_DLLPUBLIC SwTableAutoFmt
 
 SwBoxAutoFmt* aBoxAutoFmt[ 16 ];
 
-// Writer-specific options
-SvxFmtBreakItem m_aBreak;
-SwFmtPageDesc m_aPageDesc;
-SvxFmtKeepItem m_aKeepWithNextPara;
-sal_uInt16 m_aRepeatHeading;
-sal_Bool m_bLayoutSplit;
-sal_Bool m_bRowSplit;
-sal_Bool m_bCollapsingBorders;
-SvxShadowItem m_aShadow;
-
 public:
 SwTableAutoFmt( const String rName, SwTableFmt* pTableStyle );
 SwTableAutoFmt( const SwTableAutoFmt rNew );
@@ -266,6 +256,8 @@ public:
 
 SwTableAutoFmt operator=( const SwTableAutoFmt rNew );
 
+SwTableFmt* GetTableStyle() { return m_pTableStyle; }
+
 void SetBoxFmt( const SwBoxAutoFmt rNew, sal_uInt8 nPos );
 const SwBoxAutoFmt GetBoxFmt( sal_uInt8 nPos ) const;
 
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index b3cd7ff..c3fcd1a 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -22,7 +22,15 @@
 SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
+, m_aRepeatHeading( 0 )
+, m_bRowSplit( sal_True )
 {
+SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
+SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
+SetLayoutSplit( sal_True );
+SetCollapsingBorders( sal_True );
+SetShadow( SvxShadowItem( RES_SHADOW ) );
+
 pFstLineFmt = NULL;
 pLstLineFmt = NULL;
 pOddLineFmt = NULL;
@@ -37,7 +45,15 @@ SwTableFmt::SwTableFmt( SwAttrPool rPool, const sal_Char* 
pFmtNm,
 SwTableFmt::SwTableFmt( SwAttrPool rPool, const String rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
+, m_aRepeatHeading( 0 )
+, m_bRowSplit( sal_True )
 {
+SetBreak( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
+SetKeepWithNextPara( SvxFmtKeepItem( sal_False, RES_KEEP ) );
+SetLayoutSplit( sal_True );
+SetCollapsingBorders( sal_True );
+SetShadow( SvxShadowItem( RES_SHADOW ) );
+
 pFstLineFmt = NULL;
 pLstLineFmt = NULL;
 pOddLineFmt = NULL;
@@ -49,6 +65,87

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-06-27 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |4 +---
 sw/source/core/doc/swtblfmt.cxx |   19 ++-
 2 files changed, 3 insertions(+), 20 deletions(-)

New commits:
commit b39608c64cd67190f23b6e51f156ddb5e4458ddd
Author: Alex Ivan alexni...@yahoo.com
Date:   Thu Jun 27 21:25:13 2013 +0300

Use inherited methods in SwTableFmt

Removed methods of SwTableFmt which corresponded in name and
functionality with those defined in base class SwFmt.

Change-Id: I3a70194b2f2d8c50a090ae201b8e65cf8556cd16

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index a068fb9..ef66a10 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -24,6 +24,7 @@
 #include editeng/shaditem.hxx
 #include fmtpdsc.hxx
 #include fmtlsplt.hxx
+#include frmatr.hxx
 #include frmfmt.hxx
 
 class SwDoc;
@@ -90,12 +91,9 @@ public:
 void SetCollapsingBorders( const sal_Bool rNew );
 void SetShadow( const SvxShadowItem rNew );
 
-const SvxFmtBreakItem GetBreak() const;
-const SwFmtPageDesc GetPageDesc() const;
 const SvxFmtKeepItem GetKeepWithNextPara() const;
 sal_Bool GetLayoutSplit() const;
 sal_Bool GetCollapsingBorders() const;
-const SvxShadowItem GetShadow() const;
 
 TYPEINFO(); // Already in base class Content.
 
diff --git a/sw/source/core/doc/swtblfmt.cxx b/sw/source/core/doc/swtblfmt.cxx
index c3fcd1a..3421db4 100644
--- a/sw/source/core/doc/swtblfmt.cxx
+++ b/sw/source/core/doc/swtblfmt.cxx
@@ -116,24 +116,14 @@ void SwTableFmt::SetShadow( const SvxShadowItem rNew )
 SetFmtAttr( rNew );
 }
 
-const SvxFmtBreakItem SwTableFmt::GetBreak() const
-{
-return static_castconst SvxFmtBreakItem( GetFmtAttr( RES_BREAK ) );
-}
-
-const SwFmtPageDesc SwTableFmt::GetPageDesc() const
-{
-return static_castconst SwFmtPageDesc( GetFmtAttr( RES_PAGEDESC ) );
-}
-
 const SvxFmtKeepItem SwTableFmt::GetKeepWithNextPara() const
 {
-return static_castconst SvxFmtKeepItem( GetFmtAttr( RES_KEEP ) );
+return SwFmt::GetKeep();
 }
 
 sal_Bool SwTableFmt::GetLayoutSplit() const
 {
-return (static_castconst SwFmtLayoutSplit( GetFmtAttr( RES_LAYOUT_SPLIT 
) )).GetValue();
+return SwFmt::GetLayoutSplit().GetValue();
 }
 
 sal_Bool SwTableFmt::GetCollapsingBorders() const
@@ -141,11 +131,6 @@ sal_Bool SwTableFmt::GetCollapsingBorders() const
 return (static_castconst SfxBoolItem( GetFmtAttr( 
RES_COLLAPSING_BORDERS ) )).GetValue();
 }
 
-const SvxShadowItem SwTableFmt::GetShadow() const
-{
-return static_castconst SvxShadowItem( GetFmtAttr( RES_SHADOW ) );
-}
-
 SwTableLineFmt::SwTableLineFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc sw/source

2013-06-25 Thread Alex Ivan
Rebased ref, commits from common ancestor:
commit e303aa5e568707cfb3a35315dbb645fc7d950e74
Author: Alex Ivan alexni...@yahoo.com
Date:   Tue Jun 25 14:22:06 2013 +0300

Revert prev changes; add SwTableFmt to Autoformat

Changes made in previous patch have been reverted.

A SwTableFmt memeber has been added to SwTableAutoFmt in
order to enable gradual transfer of items from one to
the other, while maintaining current functionality.

Change-Id: I844f77914277ed6f5e115aa82f41e753589c7057

diff --git a/sw/inc/tblafmt.hxx b/sw/inc/tblafmt.hxx
index 7340427..1988933 100644
--- a/sw/inc/tblafmt.hxx
+++ b/sw/inc/tblafmt.hxx
@@ -233,6 +233,7 @@ class SW_DLLPUBLIC SwTableAutoFmt
 friend void _FinitCore();   // To destroy dflt. pointer.
 static SwBoxAutoFmt* pDfltBoxAutoFmt;
 
+SwTableFmt* m_pTableStyle;
 String aName;
 sal_uInt16 nStrResId;
 
@@ -259,7 +260,7 @@ class SW_DLLPUBLIC SwTableAutoFmt
 SvxShadowItem m_aShadow;
 
 public:
-SwTableAutoFmt( const String rName );
+SwTableAutoFmt( const String rName, SwTableFmt* pTableStyle );
 SwTableAutoFmt( const SwTableAutoFmt rNew );
 ~SwTableAutoFmt();
 
@@ -293,7 +294,7 @@ public:
 void SetValueFormat( const sal_Bool bNew )  { bInclValueFormat = bNew; }
 void SetWidthHeight( const sal_Bool bNew )  { bInclWidthHeight = bNew; }
 
-sal_Bool Load( SvStream rStream, const SwAfVersions );
+static SwTableAutoFmt* Load( SvStream rStream, const SwAfVersions, 
SwDoc* pDoc );
 sal_Bool Save( SvStream rStream, sal_uInt16 fileVersion ) const;
 };
 
@@ -301,12 +302,13 @@ class SW_DLLPUBLIC SwTableAutoFmtTbl
 {
 struct Impl;
 ::boost::scoped_ptrImpl m_pImpl;
+SwDoc* m_pDoc;
 
 SW_DLLPRIVATE sal_Bool Load( SvStream rStream );
 SW_DLLPRIVATE sal_Bool Save( SvStream rStream ) const;
 
 public:
-explicit SwTableAutoFmtTbl();
+explicit SwTableAutoFmtTbl(SwDoc* pDoc);
 ~SwTableAutoFmtTbl();
 
 size_t size() const;
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 2031563..bb4e682 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -590,8 +590,9 @@ sal_Bool SwBoxAutoFmt::SaveVersionNo( SvStream rStream, 
sal_uInt16 fileVersion
 
 
 
-SwTableAutoFmt::SwTableAutoFmt( const String rName )
-: aName( rName )
+SwTableAutoFmt::SwTableAutoFmt( const String rName, SwTableFmt* pTableStyle )
+: m_pTableStyle( pTableStyle )
+, aName( rName )
 , nStrResId( USHRT_MAX )
 , m_aBreak( SVX_BREAK_NONE, RES_BREAK )
 , m_aKeepWithNextPara( sal_False, RES_KEEP )
@@ -639,6 +640,7 @@ SwTableAutoFmt SwTableAutoFmt::operator=( const 
SwTableAutoFmt rNew )
 aBoxAutoFmt[ n ] = 0;
 }
 
+m_pTableStyle = rNew.m_pTableStyle;
 aName = rNew.aName;
 nStrResId = rNew.nStrResId;
 bInclFont = rNew.bInclFont;
@@ -913,8 +915,10 @@ void SwTableAutoFmt::StoreTableProperties(const SwTable 
table)
 m_aShadow = static_castconst SvxShadowItem(rSet.Get(RES_SHADOW));
 }
 
-sal_Bool SwTableAutoFmt::Load( SvStream rStream, const SwAfVersions 
rVersions )
+SwTableAutoFmt* SwTableAutoFmt::Load( SvStream rStream, const SwAfVersions 
rVersions, SwDoc* pDoc )
 {
+SwTableAutoFmt* pRet = NULL;
+
 sal_uInt16  nVal = 0;
 rStream  nVal;
 sal_Bool bRet = 0 == rStream.GetError();
@@ -925,7 +929,8 @@ sal_Bool SwTableAutoFmt::Load( SvStream rStream, const 
SwAfVersions rVersions
 sal_Bool b;
 // --- from 680/dr25 on: store strings as UTF-8
 CharSet eCharSet = (nVal = AUTOFORMAT_ID_680DR25) ? 
RTL_TEXTENCODING_UTF8 : rStream.GetStreamCharSet();
-aName = rStream.ReadUniOrByteString( eCharSet );
+OUString aName = rStream.ReadUniOrByteString( eCharSet );
+sal_uInt16 nStrResId  = USHRT_MAX;
 if( AUTOFORMAT_DATA_ID_552 = nVal )
 {
 rStream  nStrResId;
@@ -938,24 +943,34 @@ sal_Bool SwTableAutoFmt::Load( SvStream rStream, const 
SwAfVersions rVersions
 else
 nStrResId = USHRT_MAX;
 }
-rStream  b; bInclFont = b;
-rStream  b; bInclJustify = b;
-rStream  b; bInclFrame = b;
-rStream  b; bInclBackground = b;
-rStream  b; bInclValueFormat = b;
-rStream  b; bInclWidthHeight = b;
+
+// FIXME Yuk! we are creating the table styles ATM, but in the 
targetted
+// ideal, the table styles are created with the document
+SwTableFmt* pStyle = pDoc-FindTblFmtByName(aName);
+if ( !pStyle )
+pStyle = pDoc-MakeTblFrmFmt(aName, NULL);
+pRet = new SwTableAutoFmt( aName, pStyle );
+
+pRet-nStrResId = nStrResId;
+
+rStream  b; pRet-bInclFont = b;
+rStream  b; pRet-bInclJustify = b;
+rStream  b; pRet-bInclFrame = b;
+rStream  b; pRet-bInclBackground = b;
+rStream  b; pRet-bInclValueFormat = b;
+rStream  b; pRet-bInclWidthHeight = b;
 
 if (nVal

[Libreoffice-commits] core.git: Branch 'feature/table-style' - sw/inc

2013-06-25 Thread Alex Ivan
 sw/inc/swtblfmt.hxx |   89 +---
 1 file changed, 84 insertions(+), 5 deletions(-)

New commits:
commit f5beea954e1cfe38de9608c6fb8431b1c67f10e5
Author: Alex Ivan alexni...@yahoo.com
Date:   Tue Jun 25 18:44:36 2013 +0300

Add structure for format classes

SwTableFmt now stores data about the lines/columns.
These, in turn, store information about the boxes.

Not yet integrated with the current implementation.

Change-Id: Ibc936f68c20905fca1cd636977eb47850eb0faa9

diff --git a/sw/inc/swtblfmt.hxx b/sw/inc/swtblfmt.hxx
index a54faa49..76c6311 100644
--- a/sw/inc/swtblfmt.hxx
+++ b/sw/inc/swtblfmt.hxx
@@ -22,6 +22,8 @@
 #include frmfmt.hxx
 
 class SwDoc;
+class SwTableLineFmt;
+class SwTableBoxFmt;
 
 class SW_DLLPUBLIC SwTableFmt : public SwFrmFmt
 {
@@ -31,14 +33,64 @@ protected:
 SwTableFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-{}
+{
+pFstLineFmt = NULL;
+pLstLineFmt = NULL;
+pOddLineFmt = NULL;
+pEvnLineFmt = NULL;
+
+pFstColFmt = NULL;
+pLstColFmt = NULL;
+pOddColFmt = NULL;
+pEvnColFmt = NULL;
+}
 SwTableFmt( SwAttrPool rPool, const String rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableSetRange )
-{}
-
+{
+pFstLineFmt = NULL;
+pLstLineFmt = NULL;
+pOddLineFmt = NULL;
+pEvnLineFmt = NULL;
+
+pFstColFmt = NULL;
+pLstColFmt = NULL;
+pOddColFmt = NULL;
+pEvnColFmt = NULL;
+}
+
+SwTableLineFmt* pFstLineFmt;
+SwTableLineFmt* pLstLineFmt;
+SwTableLineFmt* pOddLineFmt;
+SwTableLineFmt* pEvnLineFmt;
+
+SwTableLineFmt* pFstColFmt;
+SwTableLineFmt* pLstColFmt;
+SwTableLineFmt* pOddColFmt;
+SwTableLineFmt* pEvnColFmt;
 
 public:
+
+void SetFirstLineFmt( SwTableLineFmt* pNew ) { pFstLineFmt = pNew; }
+void SetLastLineFmt( SwTableLineFmt* pNew ) { pLstLineFmt = pNew; }
+void SetOddLineFmt( SwTableLineFmt* pNew ) { pOddLineFmt = pNew; }
+void SetEvenLineFmt( SwTableLineFmt* pNew ) { pEvnLineFmt = pNew; }
+
+void SetFirstColFmt( SwTableLineFmt* pNew ) { pFstColFmt = pNew; }
+void SetLastColFmt( SwTableLineFmt* pNew ) { pLstColFmt = pNew; }
+void SetOddColFmt( SwTableLineFmt* pNew ) { pOddColFmt = pNew; }
+void SetEvenColFmt( SwTableLineFmt* pNew ) { pEvnColFmt = pNew; }
+
+SwTableLineFmt* GetFirstLineFmt() { return pFstLineFmt; }
+SwTableLineFmt* GetLastLineFmt() { return pLstLineFmt; }
+SwTableLineFmt* GetOddLineFmt() { return pOddLineFmt; }
+SwTableLineFmt* GetEvenLineFmt() { return pEvnLineFmt; }
+
+SwTableLineFmt* GetFirstColFmt() { return pFstColFmt; }
+SwTableLineFmt* GetLastColFmt() { return pLstColFmt; }
+SwTableLineFmt* GetOddColFmt() { return pOddColFmt; }
+SwTableLineFmt* GetEvenColFmt() { return pEvnColFmt; }
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableFmt)
@@ -52,13 +104,40 @@ protected:
 SwTableLineFmt( SwAttrPool rPool, const sal_Char* pFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, pFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
-{}
+{
+pFstBoxFmt = NULL;
+pLstBoxFmt = NULL;
+pOddBoxFmt = NULL;
+pEvnBoxFmt = NULL;
+}
 SwTableLineFmt( SwAttrPool rPool, const String rFmtNm,
 SwFrmFmt *pDrvdFrm )
 : SwFrmFmt( rPool, rFmtNm, pDrvdFrm, RES_FRMFMT, aTableLineSetRange )
-{}
+{
+pFstBoxFmt = NULL;
+pLstBoxFmt = NULL;
+pOddBoxFmt = NULL;
+pEvnBoxFmt = NULL;
+}
+
+// Odd and Even Box formats will be used to handle alternating columns
+SwTableBoxFmt* pFstBoxFmt;
+SwTableBoxFmt* pLstBoxFmt;
+SwTableBoxFmt* pOddBoxFmt;
+SwTableBoxFmt* pEvnBoxFmt;
 
 public:
+
+void SetFirstBoxFmt( SwTableBoxFmt* pNew ) { pFstBoxFmt = pNew; }
+void SetLastBoxFmt( SwTableBoxFmt* pNew ) { pLstBoxFmt = pNew; }
+void SetOddBoxFmt( SwTableBoxFmt* pNew ) { pOddBoxFmt = pNew; }
+void SetEvenBoxFmt( SwTableBoxFmt* pNew ) { pEvnBoxFmt = pNew; }
+
+SwTableBoxFmt* GetFirstBoxFmt() { return pFstBoxFmt; }
+SwTableBoxFmt* GetLastBoxFmt() { return pLstBoxFmt; }
+SwTableBoxFmt* GetOddBoxFmt() { return pOddBoxFmt; }
+SwTableBoxFmt* GetEvenBoxFmt() { return pEvnBoxFmt; }
+
 TYPEINFO(); // Already in base class Content.
 
 DECL_FIXEDMEMPOOL_NEWDEL(SwTableLineFmt)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Changes to 'feature/table-style'

2013-06-22 Thread Alex Ivan
New branch 'feature/table-style' available with the following commits:
commit 24fa9beab933d83eef59a36852ab45301cb9dd86
Author: Alex Ivan alexni...@yahoo.com
Date:   Sat Jun 22 18:19:35 2013 +0300

Moved format information to SwTable*Fmt

Attempted to move the functionality of the current autoformat into the
table format classes: SwTableFmt, SwTableLineFmt, SwTableColFmt,
SwTableBoxFmt.

Issues:

* Peculiar error when building after trying to implement SwTableColFmt.
Attributes for columns will be properly modified in
/sw/source/core/bastyp/init.cxx once this is solved.

* Should discuss how pointers to default formats for boxes/lines/columns
are to be initialized from now, or whether the mechanic should be
removed.

* Also, not sure what attributes should be stored by each class.
Currently, they are basically stored identically to the AutoFormat
classes which are in use at the moment.

* The hierarchy of the SwTable*Fmt classes is also subject to
modification, should it be deemed necessary.

Change-Id: I9c8b24d95f0876e46a3914d71073a53bcf1203fb

___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[GSoC 2013] Implementing Writer Table Styles

2013-05-30 Thread Alex Ivan
Hello everybody, 

I would like to begin by saying what an honor it is for me to be working on
such an important software suite.

My project aims to replace the current system in which the user must reapply
the chosen auto-format for each added cell with proper formatting for an
entire table.

I have set up a blog to make it easier to track my project here [0].

The RSS feed is [1].

During the next week I will give implementing this feature a good thought
and will discuss details with my mentor.

[0]http://gsoc2013tables.blogspot.ro/
[1]http://gsoc2013tables.blogspot.ro/feeds/posts/default?alt=rss

Best regards,

Alex Ivan
irc: alexnivan



--
View this message in context: 
http://nabble.documentfoundation.org/GSoC-2013-Implementing-Writer-Table-Styles-tp4058683.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[Libreoffice-commits] core.git: framework/source

2013-05-03 Thread Alex Ivan
 framework/source/uiconfiguration/uiconfigurationmanager.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit da06166015689eca260c702602bef4cea58afbd3
Author: Alex Ivan alexni...@yahoo.com
Date:   Mon Apr 15 18:56:10 2013 +0300

fix bug #60700 - de-crutify ODF files

Initialization of storage elements in Configuration folder is now
done in read-only mode. Modification does not affect these folders
in case of actual storage within them.
Only tested for example posted on bugzilla page.

Added open mode directly into function call.

Change-Id: Ib2b4ae1f4cab35f2c9cd1fc7081302e1231da7a4
Reviewed-on: https://gerrit.libreoffice.org/3401
Reviewed-by: Chris Sherlock chris.sherloc...@gmail.com
Reviewed-by: Michael Meeks michael.me...@suse.com
Tested-by: Michael Meeks michael.me...@suse.com

diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index a2469e0..c32e2d9 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -540,8 +540,6 @@ void UIConfigurationManager::impl_Initialize()
 // Initialize the top-level structures with the storage data
 if ( m_xDocConfigStorage.is() )
 {
-long nModes = m_bReadOnly ? ElementModes::READ : 
ElementModes::READWRITE;
-
 // Try to access our module sub folder
 for ( sal_Int16 i = 1; i  ::com::sun::star::ui::UIElementType::COUNT;
   i++ )
@@ -549,7 +547,7 @@ void UIConfigurationManager::impl_Initialize()
 Reference XStorage  xElementTypeStorage;
 try
 {
-xElementTypeStorage = m_xDocConfigStorage-openStorageElement( 
OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), nModes );
+xElementTypeStorage = m_xDocConfigStorage-openStorageElement( 
OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), ElementModes::READ );
 }
 catch ( const com::sun::star::container::NoSuchElementException )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


Re: Need help regarding BUG #60700

2013-04-29 Thread Alex Ivan
First of all, sorry for my late response.

Secondly, I'll explain what the logic for  this bugfix
https://gerrit.libreoffice.org/#/c/3401/   was.

The idea is that the storage elements are opened again in the
UIConfigurationManager::storeToStorage method (same file), so, basically, if
there is a need to store anything, they will be reopened as writeable.

As you pointed out, my current patch does not purge these directories in
files that already contain them, but are empty.
I've found  this documentation
http://www.openoffice.org/api/docs/common/ref/com/sun/star/embed/XStorage.html
  
of the XStorage interface, but I am not quite sure how to go about
determining if the storage element is empty. There surely is something I am
missing. It would be very helpful if someone could point me in the right
direction.

Also, a bit off topic, I made a post regarding GSOC
http://nabble.documentfoundation.org/GSOC-2013-Candidate-td4051245.html  .
Since the application deadline is closing in, any kind of response would be
extremely helpful.

Best wishes,
Alex Ivan



--
View this message in context: 
http://nabble.documentfoundation.org/Need-help-regarding-BUG-60700-tp4041113p4052847.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


GSOC 2013 Candidate

2013-04-20 Thread Alex Ivan
Greetings,

My name is Ivan Alexandru, I am a second year undergraduate at Politehnica
University of Bucharest, and I am very much interested in working on
LibreOffice during this year's Summer of Code. I have a good understanding
of C/C++ and have used them in the two years at the university but never to
work on such a large project. In addition, I am familiar with Java, and also
have basic to medium understanding of Python and functional languages like
Scheme and Haskell.

I have already cloned the repo and built LO under linux. Moreover, I have
worked on this easyhack https://bugs.freedesktop.org/show_bug.cgi?id=60700
and submitted a patch. This, being a first for me, I mistakenly submitted it
to the wrong branch https://gerrit.libreoffice.org/#/c/3400/  but realized
my error and resubmitted to master https://gerrit.libreoffice.org/#/c/3401/
. As you can probably see, it ended up not being much to do, although the
bug is almost fixed, at least for the examples at hand.
I would like to know if this counts towards being eligible, as mentioned in
the application guide, or should I begin working on another easyhack to be
sure?

Also, I have taken a look through the ideas page. Two of them have captured
my interest, namely the one regarding Table Styles in Writer and the one
concerning ODF Formulas.  I have a couple of questions about these:
Which of these do you consider more important? (and if neither are on the
priority list, please point me to one that is) 
Are there any other resources I should be aware of in order to get
accustomed with the project, aside from the given code pointers?

Thank you for your time,
Alex Ivan



--
View this message in context: 
http://nabble.documentfoundation.org/GSOC-2013-Candidate-tp4051245.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH libreoffice-4-0-0] fix bug #60700 - de-crutify ODF files

2013-04-15 Thread Alex Ivan (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3400

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/00/3400/1

fix bug #60700 - de-crutify ODF files

Initialization of storage elements in Configuration folder is now
done in read-only mode. Modification does not affect these folders
in case of actual storage within them.
Only tested for example posted on bugzilla page.

Change-Id: If0f69b46b4a0a564afca4fd696320f7f2dfbca12
---
M framework/source/uiconfiguration/uiconfigurationmanager.cxx
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index a2469e0..4366b31 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -540,7 +540,7 @@
 // Initialize the top-level structures with the storage data
 if ( m_xDocConfigStorage.is() )
 {
-long nModes = m_bReadOnly ? ElementModes::READ : 
ElementModes::READWRITE;
+long nModes = ElementModes::READ;
 
 // Try to access our module sub folder
 for ( sal_Int16 i = 1; i  ::com::sun::star::ui::UIElementType::COUNT;

-- 
To view, visit https://gerrit.libreoffice.org/3400
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: If0f69b46b4a0a564afca4fd696320f7f2dfbca12
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0-0
Gerrit-Owner: Alex Ivan alexni...@yahoo.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] fix bug #60700 - de-crutify ODF files

2013-04-15 Thread Alex Ivan (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3401

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/01/3401/1

fix bug #60700 - de-crutify ODF files

Initialization of storage elements in Configuration folder is now
done in read-only mode. Modification does not affect these folders
in case of actual storage within them.
Only tested for example posted on bugzilla page.

Change-Id: Ib2b4ae1f4cab35f2c9cd1fc7081302e1231da7a4
---
M framework/source/uiconfiguration/uiconfigurationmanager.cxx
1 file changed, 1 insertion(+), 1 deletion(-)



diff --git a/framework/source/uiconfiguration/uiconfigurationmanager.cxx 
b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
index a2469e0..4366b31 100644
--- a/framework/source/uiconfiguration/uiconfigurationmanager.cxx
+++ b/framework/source/uiconfiguration/uiconfigurationmanager.cxx
@@ -540,7 +540,7 @@
 // Initialize the top-level structures with the storage data
 if ( m_xDocConfigStorage.is() )
 {
-long nModes = m_bReadOnly ? ElementModes::READ : 
ElementModes::READWRITE;
+long nModes = ElementModes::READ;
 
 // Try to access our module sub folder
 for ( sal_Int16 i = 1; i  ::com::sun::star::ui::UIElementType::COUNT;

-- 
To view, visit https://gerrit.libreoffice.org/3401
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2b4ae1f4cab35f2c9cd1fc7081302e1231da7a4
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Alex Ivan alexni...@yahoo.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Re: Need help regarding BUG #60700

2013-03-16 Thread Alex Ivan
Hi, 


Michael Meeks-2 wrote
 I've been looking into  bug #60700
 lt;https://bugs.freedesktop.org/show_bug.cgi?id=60700gt;   and have
 currently
 managed to figure out when those empty directories are created.
 
   When ? well - code-wise, I suggest you git grep for the name you find
 in the zip package:
 
   git grep 'Configurations2'
 
   Regina's pointers to the framework/ code - which is almost certainly
 the culprit might find why in fact we never write anything to them ;-)
 [ just leave them lingering around empty ].
 
   That file attached has an accelerator/current.xml listed a quick:
 
   cd framework
   git grep 'current'
 
   hit:
 
 void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const
 css::uno::Reference css::embed::XStorage  xStorage)
 throw(css::uno::Exception   ,
   css::uno::RuntimeException)

The first place that i found where these directories are created is in 
framework/source/uiconfiguration/uiconfigurationmanager.cxx: 
void UIConfigurationManager::impl_Initialize()
...
xElementTypeStorage = m_xDocConfigStorage-openStorageElement(
rtl::OUString::createFromAscii( UIELEMENTTYPENAMES[i] ), nModes ); 
...

Without this bit, an empty .odf does not end up containing those
directories.
On the one hand, there are other similar calls in this and other files, so
it may have just been a slip
up when writing these. On the other hand, i didn't have any good examples to
test this out.

Unfortunately, i have had some college homework and have not got around to
reading Regina's posts,
and, since no one responded to this for some time, i did not investigate
further.
I will do so now that there is at least one example and update you if i
figure it out.

Thank you for your help, 

Alex Ivan



--
View this message in context: 
http://nabble.documentfoundation.org/Need-help-regarding-BUG-60700-tp4041113p4044229.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Need help regarding BUG #60700

2013-03-02 Thread Alex Ivan
Hi,

I've been looking into  bug #60700
https://bugs.freedesktop.org/show_bug.cgi?id=60700   and have currently
managed to figure out when those empty directories are created.
Can anybody tell what those directories -should- contain when not empty?
Also, if someone could give me a scenario to follow in order to obtain, for
example, an .odt file in which said directories are not empty, it would
really help me.

Thanks in advance,
Alex Ivan



--
View this message in context: 
http://nabble.documentfoundation.org/Need-help-regarding-BUG-60700-tp4041113.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


Question Regarding Entry Level Hack

2013-02-23 Thread Alex Ivan
Hello,

I am a beginner developer and would like to contribute to LibreOffice during
GSOC 2013.
As suggested, I began by taking a look at the Easy Hacks page.
My question is regarding the Fix spelling errors in binaries found by
lintian entry level hack, or   fdo#60724
https://bugs.freedesktop.org/show_bug.cgi?id=60724   
I believe I have corrected the spelling errors, but would like to ask how
can I test this before submitting a patch file.
From what I have read, lintian scans software packages, not individual
files.
I would very much appreciate some assistance on this matter.

Thanks in advance, 

Alex Ivan



--
View this message in context: 
http://nabble.documentfoundation.org/Question-Regarding-Entry-Level-Hack-tp4039603.html
Sent from the Dev mailing list archive at Nabble.com.
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice