[Libreoffice-commits] core.git: writerfilter/source

Justin Luth justin_luth at sil.org
Tue Aug 22 08:10:26 UTC 2017


 writerfilter/source/dmapper/GraphicImport.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit d092521b2595963dcf0928f5fee7ed1903ff4aef
Author: Justin Luth <justin_luth at sil.org>
Date:   Sat Aug 19 22:07:41 2017 -0400

    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 at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

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));


More information about the Libreoffice-commits mailing list