[Libreoffice-commits] .: 4 commits - sw/source writerfilter/inc writerfilter/source
Cédric Bosdonnat
cbosdo at kemper.freedesktop.org
Tue Jul 31 06:24:25 PDT 2012
sw/source/core/layout/fly.cxx | 17 ++++-------------
sw/source/core/layout/frmtool.cxx | 4 ++++
sw/source/core/text/xmldump.cxx | 2 +-
writerfilter/inc/dmapper/DomainMapper.hxx | 2 ++
writerfilter/source/dmapper/DomainMapper.cxx | 5 +++++
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 6 ++++++
writerfilter/source/dmapper/DomainMapper_Impl.hxx | 2 ++
writerfilter/source/dmapper/GraphicImport.cxx | 6 ++++--
8 files changed, 28 insertions(+), 16 deletions(-)
New commits:
commit ae126d43e4737ab39e53827d9ad3bd6983577b1f
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Jul 31 15:19:23 2012 +0200
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
diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx
index b781418..c22eebe 100644
--- a/writerfilter/inc/dmapper/DomainMapper.hxx
+++ b/writerfilter/inc/dmapper/DomainMapper.hxx
@@ -108,6 +108,8 @@ public:
boost::shared_ptr< StyleSheetTable > GetStyleSheetTable( );
GraphicZOrderHelper* graphicZOrderHelper();
+ bool IsInHeaderFooter() const;
+
private:
// Stream
virtual void lcl_startSectionGroup();
diff --git a/writerfilter/source/dmapper/DomainMapper.cxx b/writerfilter/source/dmapper/DomainMapper.cxx
index 1bc0737..4aa843c 100644
--- a/writerfilter/source/dmapper/DomainMapper.cxx
+++ b/writerfilter/source/dmapper/DomainMapper.cxx
@@ -3839,6 +3839,11 @@ GraphicZOrderHelper* DomainMapper::graphicZOrderHelper()
return zOrderHelper.get();
}
+bool DomainMapper::IsInHeaderFooter() const
+{
+ return m_pImpl->IsInHeaderFooter();
+}
+
} //namespace dmapper
} //namespace writerfilter
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 73a084a..ebee085 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -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;
}
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 3e28f22..2622cb7 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -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();
diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx
index 415fa41..fb0d6fa 100644
--- a/writerfilter/source/dmapper/GraphicImport.cxx
+++ b/writerfilter/source/dmapper/GraphicImport.cxx
@@ -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));
commit da53c44d7074499db2d0ba57eee09bde6152e7ea
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Jul 31 14:46:59 2012 +0200
n#772094: pictures was eaten by document default LR settings
Why should we take care of LR Space for SwNoTxtNode... those are
images-like contents that don't contain text.
Change-Id: I58f6d77efc01febf422073032802f57c5158a034
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index b300ba0..4d2e231 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -1850,6 +1850,10 @@ SwBorderAttrs::SwBorderAttrs( const SwModify *pMod, const SwFrm *pConstructor )
{
pTxtFrm->GetTxtNode()->ClearLRSpaceItemDueToListLevelIndents( rLR );
}
+ else if ( pConstructor->IsNoTxtFrm() )
+ {
+ rLR = SvxLRSpaceItem ( RES_LR_SPACE );
+ }
//Achtung: Die USHORTs fuer die gecache'ten Werte werden absichtlich
//nicht initialisiert!
commit 40db75b69cea0aea402a4a62bba2d68a65cc9607
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Jul 31 14:46:41 2012 +0200
sw: fixed a few comments
Change-Id: Ibe34d977df2b2db42d60e45177865c0a6d11c643
diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx
index 628f9c5..bb40da1 100644
--- a/sw/source/core/layout/fly.cxx
+++ b/sw/source/core/layout/fly.cxx
@@ -91,7 +91,6 @@
using namespace ::com::sun::star;
-// OD 2004-03-23 #i26791
TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject);
/*************************************************************************
@@ -102,10 +101,7 @@ TYPEINIT2(SwFlyFrm,SwLayoutFrm,SwAnchoredObject);
SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
SwLayoutFrm( pFmt, pSib ),
- // OD 2004-03-22 #i26791#
- SwAnchoredObject(),
- // OD 2004-05-27 #i26791# - moved to <SwAnchoredObject>
-// aRelPos(),
+ SwAnchoredObject(), // #i26791#
pPrevLink( 0 ),
pNextLink( 0 ),
bInCnt( sal_False ),
@@ -171,23 +167,21 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
Frm().Width( rFrmSize.GetWidth() );
Frm().Height( rFrmSize.GetHeightSizeType() == ATT_VAR_SIZE ? MINFLY : rFrmSize.GetHeight() );
- //Hoehe Fix oder Variabel oder was?
+ // Fixed or variable Height?
if ( rFrmSize.GetHeightSizeType() == ATT_MIN_SIZE )
bMinHeight = sal_True;
else if ( rFrmSize.GetHeightSizeType() == ATT_FIX_SIZE )
bFixSize = sal_True;
- // OD 2004-02-12 #110582#-2 - insert columns, if necessary
+ // insert columns, if necessary
InsertColumns();
//Erst das Init, dann den Inhalt, denn zum Inhalt koennen widerum
//Objekte/Rahmen gehoeren die dann angemeldet werden.
InitDrawObj( sal_False );
- // OD 2004-01-19 #110582#
Chain( pAnch );
- // OD 2004-01-19 #110582#
InsertCnt();
//Und erstmal in den Wald stellen die Kiste, damit bei neuen Dokument nicht
@@ -195,7 +189,6 @@ SwFlyFrm::SwFlyFrm( SwFlyFrmFmt *pFmt, SwFrm* pSib, SwFrm *pAnch ) :
Frm().Pos().X() = Frm().Pos().Y() = FAR_AWAY;
}
-// OD 2004-01-19 #110582#
void SwFlyFrm::Chain( SwFrm* _pAnch )
{
// Connect to chain neighboors.
@@ -227,7 +220,6 @@ void SwFlyFrm::Chain( SwFrm* _pAnch )
}
}
-// OD 2004-01-19 #110582#
void SwFlyFrm::InsertCnt()
{
if ( !GetPrevLink() )
@@ -239,7 +231,7 @@ void SwFlyFrm::InsertCnt()
::_InsertCnt( Lower() ? (SwLayoutFrm*)((SwLayoutFrm*)Lower())->Lower() : (SwLayoutFrm*)this,
GetFmt()->GetDoc(), nIndex );
- //NoTxt haben immer eine FixHeight.
+ // NoTxt always have a fixed height.
if ( Lower() && Lower()->IsNoTxtFrm() )
{
bFixSize = sal_True;
@@ -248,7 +240,6 @@ void SwFlyFrm::InsertCnt()
}
}
- // OD 2004-02-12 #110582#-2
void SwFlyFrm::InsertColumns()
{
// #i97379#
commit 1cbe91a36ae730139e0a1e19f8b86d02cf08bbc0
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date: Tue Jul 31 14:45:32 2012 +0200
sw layout dump: fix wrong output for SwNoTxtFrm
Change-Id: Id795d845a6330be9ffe6f7af5cfd592f66e08387
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 6bcf270..6c99b42 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -282,7 +282,7 @@ void SwFrm::dumpAsXml( xmlTextWriterPtr writer )
name = "txt";
break;
case FRM_NOTXT:
- name = "txt";
+ name = "notxt";
break;
};
More information about the Libreoffice-commits
mailing list