diff options
author | aqcoder <flw.aquarius@gmail.com> | 2015-12-17 21:22:34 +0800 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2016-01-12 20:31:21 +0100 |
commit | a16cef75e829cd48445905fc67de625640bf6398 (patch) | |
tree | 7cf144c9ceb3c61d144fbcfd04fb7b9bf2aac2f8 /sw/source | |
parent | 8565cef55b172fd1b4825998b3e3762a530b6a6f (diff) |
tdf#96412 Fix export text table cell UserDefinedAttributes to xml.
It also export to different Fmt when only have the difference of
UserDefinedAttributes for the text table cell.
Reviewed-on: https://gerrit.libreoffice.org/20765
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: jan iversen <jani@documentfoundation.org>
Let's try to push it again, it's unclear what the tinderbox failures
were that caused it to be reverted.
Change-Id: I022b627926870b883eea363567a34b61c34ab353
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/filter/xml/xmltble.cxx | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/sw/source/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx index 47e6a0b1f41a..3e81a9018787 100644 --- a/sw/source/filter/xml/xmltble.cxx +++ b/sw/source/filter/xml/xmltble.cxx @@ -29,6 +29,7 @@ #include <svl/zforlist.hxx> #include <editeng/brushitem.hxx> #include <editeng/boxitem.hxx> +#include <editeng/xmlcnitm.hxx> #include <fmtrowsplt.hxx> #include <editeng/frmdiritem.hxx> #include <list> @@ -316,6 +317,7 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, const SvxBoxItem *pBox = nullptr; const SwTableBoxNumFormat *pNumFormat = nullptr; const SvxFrameDirectionItem *pFrameDir = nullptr; + const SvXMLAttrContainerItem *pAttCnt = nullptr; const SfxItemSet& rItemSet = rFrameFormat.GetAttrSet(); const SfxPoolItem *pItem; @@ -335,9 +337,12 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, if ( SfxItemState::SET == rItemSet.GetItemState( RES_FRAMEDIR, false, &pItem ) ) pFrameDir = static_cast<const SvxFrameDirectionItem *>(pItem); + if ( SfxItemState::SET == rItemSet.GetItemState( RES_UNKNOWNATR_CONTAINER, + false, &pItem ) ) + pAttCnt = static_cast<const SvXMLAttrContainerItem *>(pItem); // empty styles have not to be exported - if( !pVertOrient && !pBrush && !pBox && !pNumFormat && !pFrameDir ) + if( !pVertOrient && !pBrush && !pBox && !pNumFormat && !pFrameDir && !pAttCnt ) return false; // order is: -/-/-/num, @@ -355,6 +360,7 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, const SvxBoxItem *pTestBox = nullptr; const SwTableBoxNumFormat *pTestNumFormat = nullptr; const SvxFrameDirectionItem *pTestFrameDir = nullptr; + const SvXMLAttrContainerItem *pTestAttCnt = nullptr; const SwFrameFormat* pTestFormat = *i; const SfxItemSet& rTestSet = pTestFormat->GetAttrSet(); if( SfxItemState::SET == rTestSet.GetItemState( RES_VERT_ORIENT, false, @@ -428,6 +434,21 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, } + if ( SfxItemState::SET == rTestSet.GetItemState( RES_UNKNOWNATR_CONTAINER, + false, &pItem ) ) + { + if( !pAttCnt ) + break; + + pTestAttCnt = static_cast<const SvXMLAttrContainerItem *>(pItem); + } + else + { + if ( pAttCnt ) + continue; + + } + if( pVertOrient && pVertOrient->GetVertOrient() != pTestVertOrient->GetVertOrient() ) continue; @@ -444,6 +465,9 @@ bool SwXMLTableFrameFormatsSort_Impl::AddCell( SwFrameFormat& rFrameFormat, if( pFrameDir && pFrameDir->GetValue() != pTestFrameDir->GetValue() ) continue; + if( pAttCnt && ( *pAttCnt != *pTestAttCnt ) ) + continue; + // found! rFrameFormat.SetName( pTestFormat->GetName() ); bInsert = false; |