diff options
author | Lei De Bin <leidb@apache.org> | 2012-07-19 01:26:26 +0000 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2013-04-07 23:37:42 +0200 |
commit | 7ec7a9a68b4a9c5600840a34434fc800cda3d815 (patch) | |
tree | a1ad0e5a80ce9c37d74b54073d4ebc574b4d654a | |
parent | ad2651af85181235a0c3a44bf93d7ecb08dd9353 (diff) |
Fix #120224# Mapping the text rotation in Writer table cell with MSO
Reported by: Yan Ji
Patch by: Chen Zuo Jun
Review by: Lei De Bin
Conflicts:
sw/source/filter/ww8/wrtww8.cxx
Change-Id: I4d830cbedc033ec7abb6d0d1d4e1572ce5f45c26
-rw-r--r-- | sw/source/filter/ww8/wrtww8.cxx | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 550e1af2622f..e997d6194f5e 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -109,6 +109,7 @@ #include <rtl/random.h> #include <vcl/svapp.hxx> #include "WW8Sttbf.hxx" +#include <editeng/charrotateitem.hxx> #include "WW8FibData.hxx" #include "numrule.hxx"//For i120928 @@ -1969,7 +1970,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa } } -static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox, sal_Int32 nRowSpan) +static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, sal_Int32 nRowSpan) { sal_uInt16 nFlags = 0; @@ -1992,6 +1993,31 @@ static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox, sal_Int32 nRowSpan) default: break; } + const SwStartNode * pSttNd = pBox->GetSttNd(); + if(pSttNd) + { + SwNodeIndex aIdx( *pSttNd ); + const SwCntntNode * pCNd = pSttNd->GetNodes().GoNext( &aIdx ); + if( pCNd && pCNd->IsTxtNode()) + { + SfxItemSet aCoreSet(rDoc.GetAttrPool(), RES_CHRATR_ROTATE, RES_CHRATR_ROTATE); + ((SwTxtNode*)pCNd)->GetAttr( aCoreSet, 0, !((SwTxtNode*)pCNd)->GetTxt().isEmpty()); + const SvxCharRotateItem * pRotate = NULL; + const SfxPoolItem * pRotItem; + if ( SFX_ITEM_SET == aCoreSet.GetItemState(RES_CHRATR_ROTATE, sal_True, &pRotItem)) + { + pRotate = (SvxCharRotateItem*)pRotItem; + if(pRotate && pRotate->GetValue() == 900) + { + nFlags = nFlags | 0x0004 | 0x0008; + } + else if(pRotate && pRotate->GetValue() == 2700 ) + { + nFlags = nFlags | 0x0004 | 0x0010; + } + } + } + } } return nFlags; @@ -2264,7 +2290,7 @@ void WW8AttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t if ( m_rWW8Export.bWrtWW8 ) { sal_uInt16 nFlags = - lcl_TCFlags(pTabBox1, *aItRowSpans); + lcl_TCFlags(*m_rWW8Export.pDoc, pTabBox1, *aItRowSpans); m_rWW8Export.InsUInt16( nFlags ); } |