diff options
author | Lei De Bin <leidb@apache.org> | 2012-07-19 01:26:26 +0000 |
---|---|---|
committer | Lei De Bin <leidb@apache.org> | 2012-07-19 01:26:26 +0000 |
commit | f848fc9e9708916dd24fe64646486db0d90996c7 (patch) | |
tree | 668e1dc9bbb6ace2f950eb226d8423f451c9d94a /sw | |
parent | 2586f214e48d0d63bd5a83addd48a285ee38e92f (diff) |
#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
Notes
Notes:
merged as: 7ec7a9a68b4a9c5600840a34434fc800cda3d815
Diffstat (limited to 'sw')
-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 e7b5d1dc4dea..2bf9f9cb43f4 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -117,6 +117,7 @@ #include <osl/time.h> #include <rtl/random.h> #include "WW8Sttbf.hxx" +#include <editeng/charrotateitem.hxx> #include "WW8FibData.hxx" using namespace sw::util; @@ -1930,7 +1931,7 @@ void WW8AttributeOutput::TableInfoRow( ww8::WW8TableNodeInfoInner::Pointer_t pTa } } -static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox, long nRowSpan) +static sal_uInt16 lcl_TCFlags(SwDoc &rDoc, const SwTableBox * pBox, long nRowSpan) { sal_uInt16 nFlags = 0; @@ -1953,6 +1954,31 @@ static sal_uInt16 lcl_TCFlags(const SwTableBox * pBox, long 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().Len()); + 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; @@ -2248,7 +2274,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 ); } |