summaryrefslogtreecommitdiff
path: root/writerfilter/source
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-08-19 22:07:41 -0400
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-22 10:08:08 +0200
commitd092521b2595963dcf0928f5fee7ed1903ff4aef (patch)
treea3da207f776ccacbc08111c9a15fdeb4f0a66de5 /writerfilter/source
parent9f794e4cf619210d3ce7cfbab51a36ea14c4ad8d (diff)
writerfilter: default graphics in header to the background.
Instead of always qualifying each bOpaque query with an additional check to see if it is in the header/footer, base the default value conditionally on IsInHeaderFooter(). This doesn't cause any logic change, but it does re-enforce the concept that for compatibility, graphics in header/footers are always behind the text. Especially helpful to prevent errors in future uses of bOpaque that otherwise might miss this important qualification. Change-Id: I7c0142f220d454c09ff14af65382317273402a86 Reviewed-on: https://gerrit.libreoffice.org/41346 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source')
-rw-r--r--writerfilter/source/dmapper/GraphicImport.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 12f2e1130638..65a20747c38f 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -265,7 +265,7 @@ public:
,nVertRelation( text::RelOrientation::FRAME )
,nWrap(text::WrapTextMode_NONE)
,bLayoutInCell(false)
- ,bOpaque( true )
+ ,bOpaque( !rDMapper.IsInHeaderFooter() )
,bContour(false)
,bContourOutside(true)
,nLeftMargin(319)
@@ -839,8 +839,7 @@ void GraphicImport::lcl_attribute(Id nName, Value& rValue)
xShapeProps->setPropertyValue("SurroundContour", uno::makeAny(m_pImpl->bContour));
m_pImpl->applyMargins(xShapeProps);
- bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter();
- xShapeProps->setPropertyValue("Opaque", uno::makeAny(bOpaque));
+ xShapeProps->setPropertyValue("Opaque", uno::makeAny(m_pImpl->bOpaque));
xShapeProps->setPropertyValue("Surround", uno::makeAny((sal_Int32)m_pImpl->nWrap));
m_pImpl->applyZOrder(xShapeProps);
m_pImpl->applyName(xShapeProps);
@@ -1256,11 +1255,9 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
m_pImpl->applyPosition(xGraphicObjectProperties);
m_pImpl->applyRelativePosition(xGraphicObjectProperties);
- bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter( );
- if( !bOpaque )
+ if( !m_pImpl->bOpaque )
{
- xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_OPAQUE ),
- uno::makeAny(bOpaque));
+ xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_OPAQUE ), uno::makeAny(m_pImpl->bOpaque));
}
xGraphicObjectProperties->setPropertyValue(getPropertyName( PROP_SURROUND ),
uno::makeAny((sal_Int32)m_pImpl->nWrap));