summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2016-07-23 07:54:57 +0300
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-25 06:15:21 +0000
commit9920a0bf9d783978cd6f7b97f7528d8aa2571143 (patch)
tree743264e817e78d1b08921ddf07a75f79737f0b25 /writerfilter
parent594dd232c8ff4808d4ad43cc41a9934a9c6d131d (diff)
tdf#75573 - docx handle frame properties at styles
A frame with only a style defined doesn't create paragraph properties, so the settings were just being ignored. If the stylesheet is the top context, then the settings belong to the style. If this slightly aggressive approach causes a regression, then just use the style only if the paragraph properties don't exist. Change-Id: I3b14205dc2bc5305f1eeb4cb72a812e877b532c7 Reviewed-on: https://gerrit.libreoffice.org/27453 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/dmapper/DomainMapper.cxx13
1 files changed, 7 insertions, 6 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index ba1069ac9c0d..9a391490fb6d 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -693,8 +693,13 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
case NS_ooxml::LN_CT_FramePr_hSpace:
case NS_ooxml::LN_CT_FramePr_vSpace:
{
- ParagraphProperties* pParaProperties = dynamic_cast< ParagraphProperties*>(
- m_pImpl->GetTopContextOfType( CONTEXT_PARAGRAPH ).get() );
+ ParagraphProperties* pParaProperties = nullptr;
+ // handle frame properties at styles
+ if( m_pImpl->GetTopContextType() == CONTEXT_STYLESHEET )
+ pParaProperties = dynamic_cast< ParagraphProperties*>( m_pImpl->GetTopContextOfType( CONTEXT_STYLESHEET ).get() );
+ else
+ pParaProperties = dynamic_cast< ParagraphProperties*>( m_pImpl->GetTopContextOfType( CONTEXT_PARAGRAPH ).get() );
+
if( pParaProperties )
{
switch( nName )
@@ -822,10 +827,6 @@ void DomainMapper::lcl_attribute(Id nName, Value & val)
default:;
}
}
- else
- {
- //TODO: how to handle frame properties at styles
- }
}
break;
case NS_ooxml::LN_CT_TrackChange_author: