Kaydet (Commit) ae126d43 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

n#772094: writerfilter, pictures anchored in header/footer won't be opaque

This dark magic is needed to have a behavior similar to the one of Word
for images anchored in headers/footers. Writer can't have pictures laid
over the header/footer but below the body text.

Change-Id: I2c001d4f696c1623370c531059b74e3d5fa4f5b7
üst da53c44d
......@@ -108,6 +108,8 @@ public:
boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( );
GraphicZOrderHelper* graphicZOrderHelper();
bool IsInHeaderFooter() const;
private:
// Stream
virtual void lcl_startSectionGroup();
......
......@@ -3839,6 +3839,11 @@ GraphicZOrderHelper* DomainMapper::graphicZOrderHelper()
return zOrderHelper.get();
}
bool DomainMapper::IsInHeaderFooter() const
{
return m_pImpl->IsInHeaderFooter();
}
} //namespace dmapper
} //namespace writerfilter
......
......@@ -192,6 +192,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_sCurrentParaStyleId(),
m_bInStyleSheetImport( false ),
m_bInAnyTableImport( false ),
m_bInHeaderFooterImport( false ),
m_bLineNumberingSet( false ),
m_bIsInFootnoteProperties( true ),
m_bIsCustomFtnMark( false ),
......@@ -1268,6 +1269,8 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendTextSectionAfter(
void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType)
{
m_bInHeaderFooterImport = true;
//get the section context
PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION);
//ask for the header name of the given type
......@@ -1307,6 +1310,8 @@ void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType)
void DomainMapper_Impl::PushPageFooter(SectionPropertyMap::PageType eType)
{
m_bInHeaderFooterImport = true;
//get the section context
PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION);
//ask for the footer name of the given type
......@@ -1350,6 +1355,7 @@ void DomainMapper_Impl::PopPageHeaderFooter()
RemoveLastParagraph( );
if (!m_aTextAppendStack.empty())
m_aTextAppendStack.pop();
m_bInHeaderFooterImport = false;
}
......
......@@ -332,6 +332,7 @@ private:
OUString m_sCurrentParaStyleId;
bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos
bool m_bInAnyTableImport; //in import of fonts, styles, lists or lfos
bool m_bInHeaderFooterImport;
bool m_bLineNumberingSet;
bool m_bIsInFootnoteProperties;
......@@ -499,6 +500,7 @@ public:
void PushPageFooter(SectionPropertyMap::PageType eType);
void PopPageHeaderFooter();
bool IsInHeaderFooter() const { return m_bInHeaderFooterImport; }
void PushFootOrEndnote( bool bIsFootnote );
void PopFootOrEndnote();
......
......@@ -1390,10 +1390,12 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
uno::makeAny(m_pImpl->nTopPosition));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_RELATION ),
uno::makeAny(m_pImpl->nVertRelation));
if( !m_pImpl->bOpaque )
bool bOpaque = m_pImpl->bOpaque && !m_pImpl->rDomainMapper.IsInHeaderFooter( );
if( !bOpaque )
{
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_OPAQUE ),
uno::makeAny(m_pImpl->bOpaque));
uno::makeAny(bOpaque));
}
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND ),
uno::makeAny(m_pImpl->nWrap));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment