summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@suse.cz>2012-09-20 18:26:03 +0200
committerLuboš Luňák <l.lunak@suse.cz>2012-10-03 15:03:38 +0200
commit3413841785496171a7a91a371355a7efc6ca0a2f (patch)
treefac228741db8a6805834d82bc0522343cf97c9fc /writerfilter
parentecb252af18f64b99f4ecfe34512dedfb7655fb40 (diff)
probably a rather ugly hack for inline text frame in a table (bnc#780851)
Change-Id: I2bd76799cf0a5da09664d0e1b1a9adb466633be1
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx18
-rw-r--r--writerfilter/source/dmapper/PropertyMap.hxx2
2 files changed, 17 insertions, 3 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 64618bf08614..c5a42a9fa36a 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -1273,8 +1273,22 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_center :nIntValue = text::VertOrientation::CENTER;break;
case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_bottom :
case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_outside :nIntValue = text::VertOrientation::BOTTOM;break;
- case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline ://todo: what to do with inline - no avail. in WW97 and WW2007
- //no break;
+ case NS_ooxml::LN_Value_wordprocessingml_ST_YAlign_inline :
+ {
+ // HACK: This is for bnc#780851, where a table has one cell that has w:framePr,
+ // which causes that paragraph to be converted to a text frame, and the original
+ // paragraph object no longer exists, which makes table creation fail and futhermore
+ // it would be missing in the table layout anyway. So actually no letting that paragraph
+ // be a text frame "fixes" it. I'm not sure what "inline" is supposed to mean in practice
+ // anyway, so as long as this doesn't cause trouble elsewhere ...
+ PropertyMapPtr pContext = m_pImpl->GetTopContextOfType(CONTEXT_PARAGRAPH);
+ if( pContext.get() )
+ {
+ ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pContext.get() );
+ pParaContext->SetFrameMode(false);
+ }
+ nIntValue = text::VertOrientation::NONE;
+ }
default:nIntValue = text::VertOrientation::NONE;
}
pParaProperties->SetyAlign( nIntValue );
diff --git a/writerfilter/source/dmapper/PropertyMap.hxx b/writerfilter/source/dmapper/PropertyMap.hxx
index fc88ddbcdf92..d19988a58537 100644
--- a/writerfilter/source/dmapper/PropertyMap.hxx
+++ b/writerfilter/source/dmapper/PropertyMap.hxx
@@ -305,7 +305,7 @@ public:
int operator==(const ParagraphProperties&); //does not compare the starting/ending range, m_sParaStyleName and m_nDropCapLength
- void SetFrameMode() { m_bFrameMode = true; }
+ void SetFrameMode( bool set = true ) { m_bFrameMode = set; }
bool IsFrameMode()const { return m_bFrameMode; }
void SetDropCap( sal_Int32 nSet ) { m_nDropCap = nSet; }