You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ch...@apache.org on 2012/06/26 03:29:14 UTC
svn commit: r1353791 -
/incubator/ooo/trunk/main/sw/source/core/unocore/unoframe.cxx
Author: chengjh
Date: Tue Jun 26 01:29:13 2012
New Revision: 1353791
URL: http://svn.apache.org/viewvc?rev=1353791&view=rev
Log:
Fix issue #i119922: Graphic in header and footer can not be displayed correctly
* sw/source/core/unocore/unoframe.cxx
odf compatibility
Patch by: Jane Kang,<ka...@gmail.com>
Found by: Yan Ji,<ya...@gmail.com>
Review by: Jian Hong Cheng,<ch...@apache.org>
Modified:
incubator/ooo/trunk/main/sw/source/core/unocore/unoframe.cxx
Modified: incubator/ooo/trunk/main/sw/source/core/unocore/unoframe.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/sw/source/core/unocore/unoframe.cxx?rev=1353791&r1=1353790&r2=1353791&view=diff
==============================================================================
--- incubator/ooo/trunk/main/sw/source/core/unocore/unoframe.cxx (original)
+++ incubator/ooo/trunk/main/sw/source/core/unocore/unoframe.cxx Tue Jun 26 01:29:13 2012
@@ -103,6 +103,10 @@
#include <vos/mutex.hxx>
#include <vcl/svapp.hxx>
#include <sfx2/printer.hxx>
+//Begin Bug 119922
+#include <sfx2/docfile.hxx>
+#include <sfx2/docfilt.hxx>
+//End Bug 119922
#include <SwStyleNameMapper.hxx>
#include <xmloff/xmlcnitm.hxx>
#include <poolfmt.hxx>
@@ -143,7 +147,13 @@ public:
// void GetProperty(const OUString &rPropertyName, const uno::Reference < beans::XPropertySet > &rxPropertySet, uno::Any& rAny );
// const SfxItemPropertyMap* GetMap() const {return _pMap;}
- sal_Bool FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet &rFromSet, sal_Bool& rSizeFound);
+ //Begin Bug 119922:Graphic in header and footer can not be displayed correctly.
+ //Set default value for "Follow text flow" to false if a previous version didn't support "Follow text flow".
+ sal_Bool FillBaseProperties(SfxItemSet& rToSet,
+ const SfxItemSet &rFromSet,
+ sal_Bool& rSizeFound,
+ const sal_Bool bOasis = sal_False );
+ //End Bug 119922
virtual sal_Bool AnyToItemSet( SwDoc* pDoc, SfxItemSet& rFrmSet, SfxItemSet& rSet, sal_Bool& rSizeFound) = 0;
@@ -163,7 +173,13 @@ sal_Bool BaseFrameProperties_Impl::GetPr
return aAnyMap.FillValue( nWID, nMemberId, rpAny );
}
-sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxItemSet& rFromSet, sal_Bool& rSizeFound)
+//Begin Bug 119922:Graphic in header and footer can not be displayed correctly.
+//Set default value for "Follow text flow" to false if a previous version didn't support "Follow text flow".
+sal_Bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet,
+ const SfxItemSet& rFromSet,
+ sal_Bool& rSizeFound,
+ const sal_Bool bOasis /*sal_False*/ )
+//End Bug 119922
{
sal_Bool bRet = sal_True;
//Anker kommt auf jeden Fall in den Set
@@ -497,6 +513,10 @@ sal_Bool BaseFrameProperties_Impl::FillB
aFmtFollowTextFlow.PutValue(*pFollowTextFlow, 0);
rToSet.Put(aFmtFollowTextFlow);
}
+ //Begin Bug 119922
+ else if ( bOasis )
+ rToSet.Put( SwFmtFollowTextFlow() );
+ //End Bug 119922
// OD 2004-05-04 #i28701# - RES_WRAP_INFLUENCE_ON_OBJPOS
const ::uno::Any* pWrapInfluenceOnObjPos = 0;
@@ -636,7 +656,15 @@ sal_Bool SwGraphicProperties_Impl::AnyT
{
rtl::Reference< SwDocStyleSheet > xStyle( new SwDocStyleSheet(*pStyle) );
const :: SfxItemSet *pItemSet = &xStyle->GetItemSet();
- bRet = FillBaseProperties(rFrmSet, *pItemSet, rSizeFound);
+ //Begin Bug 119922
+ sal_Bool bOasis = sal_False;
+ SfxMedium* pMedium = NULL;
+ const SfxFilter * pFilter = NULL;
+ if ( ( pMedium = pDoc->GetDocShell()->GetMedium() ) &&
+ ( pFilter = pMedium->GetFilter() ) )
+ bOasis = pFilter->GetVersion() > SOFFICE_FILEFORMAT_60;
+ bRet = FillBaseProperties( rFrmSet, *pItemSet, rSizeFound, bOasis );
+ //End Bug 119922
lcl_FillMirror ( rGrSet, *pItemSet, pHEvenMirror, pHOddMirror, pVMirror, bRet );
}
else