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: ...@@ -108,6 +108,8 @@ public:
boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( ); boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( );
GraphicZOrderHelper* graphicZOrderHelper(); GraphicZOrderHelper* graphicZOrderHelper();
bool IsInHeaderFooter() const;
private: private:
// Stream // Stream
virtual void lcl_startSectionGroup(); virtual void lcl_startSectionGroup();
......
...@@ -3839,6 +3839,11 @@ GraphicZOrderHelper* DomainMapper::graphicZOrderHelper() ...@@ -3839,6 +3839,11 @@ GraphicZOrderHelper* DomainMapper::graphicZOrderHelper()
return zOrderHelper.get(); return zOrderHelper.get();
} }
bool DomainMapper::IsInHeaderFooter() const
{
return m_pImpl->IsInHeaderFooter();
}
} //namespace dmapper } //namespace dmapper
} //namespace writerfilter } //namespace writerfilter
......
...@@ -192,6 +192,7 @@ DomainMapper_Impl::DomainMapper_Impl( ...@@ -192,6 +192,7 @@ DomainMapper_Impl::DomainMapper_Impl(
m_sCurrentParaStyleId(), m_sCurrentParaStyleId(),
m_bInStyleSheetImport( false ), m_bInStyleSheetImport( false ),
m_bInAnyTableImport( false ), m_bInAnyTableImport( false ),
m_bInHeaderFooterImport( false ),
m_bLineNumberingSet( false ), m_bLineNumberingSet( false ),
m_bIsInFootnoteProperties( true ), m_bIsInFootnoteProperties( true ),
m_bIsCustomFtnMark( false ), m_bIsCustomFtnMark( false ),
...@@ -1268,6 +1269,8 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendTextSectionAfter( ...@@ -1268,6 +1269,8 @@ uno::Reference< beans::XPropertySet > DomainMapper_Impl::appendTextSectionAfter(
void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType) void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType)
{ {
m_bInHeaderFooterImport = true;
//get the section context //get the section context
PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION); PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION);
//ask for the header name of the given type //ask for the header name of the given type
...@@ -1307,6 +1310,8 @@ void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType) ...@@ -1307,6 +1310,8 @@ void DomainMapper_Impl::PushPageHeader(SectionPropertyMap::PageType eType)
void DomainMapper_Impl::PushPageFooter(SectionPropertyMap::PageType eType) void DomainMapper_Impl::PushPageFooter(SectionPropertyMap::PageType eType)
{ {
m_bInHeaderFooterImport = true;
//get the section context //get the section context
PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION); PropertyMapPtr pContext = DomainMapper_Impl::GetTopContextOfType(CONTEXT_SECTION);
//ask for the footer name of the given type //ask for the footer name of the given type
...@@ -1350,6 +1355,7 @@ void DomainMapper_Impl::PopPageHeaderFooter() ...@@ -1350,6 +1355,7 @@ void DomainMapper_Impl::PopPageHeaderFooter()
RemoveLastParagraph( ); RemoveLastParagraph( );
if (!m_aTextAppendStack.empty()) if (!m_aTextAppendStack.empty())
m_aTextAppendStack.pop(); m_aTextAppendStack.pop();
m_bInHeaderFooterImport = false;
} }
......
...@@ -332,6 +332,7 @@ private: ...@@ -332,6 +332,7 @@ private:
OUString m_sCurrentParaStyleId; OUString m_sCurrentParaStyleId;
bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos bool m_bInStyleSheetImport; //in import of fonts, styles, lists or lfos
bool m_bInAnyTableImport; //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_bLineNumberingSet;
bool m_bIsInFootnoteProperties; bool m_bIsInFootnoteProperties;
...@@ -499,6 +500,7 @@ public: ...@@ -499,6 +500,7 @@ public:
void PushPageFooter(SectionPropertyMap::PageType eType); void PushPageFooter(SectionPropertyMap::PageType eType);
void PopPageHeaderFooter(); void PopPageHeaderFooter();
bool IsInHeaderFooter() const { return m_bInHeaderFooterImport; }
void PushFootOrEndnote( bool bIsFootnote ); void PushFootOrEndnote( bool bIsFootnote );
void PopFootOrEndnote(); void PopFootOrEndnote();
......
...@@ -1390,10 +1390,12 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b ...@@ -1390,10 +1390,12 @@ uno::Reference< text::XTextContent > GraphicImport::createGraphicObject( const b
uno::makeAny(m_pImpl->nTopPosition)); uno::makeAny(m_pImpl->nTopPosition));
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_RELATION ), xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_VERT_ORIENT_RELATION ),
uno::makeAny(m_pImpl->nVertRelation)); 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 ), xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_OPAQUE ),
uno::makeAny(m_pImpl->bOpaque)); uno::makeAny(bOpaque));
} }
xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND ), xGraphicObjectProperties->setPropertyValue(rPropNameSupplier.GetName( PROP_SURROUND ),
uno::makeAny(m_pImpl->nWrap)); 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