summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2003-09-04 10:47:26 +0000
committerOliver Bolte <obo@openoffice.org>2003-09-04 10:47:26 +0000
commitcef959f8b078ce5fedb4ac5adc5d65b223258680 (patch)
treec84189dfea8178b1bef09e674d526062f4ef9b9d /sw/source/core
parent17f2e50b08dc974f234364038362883aed4afeef (diff)
INTEGRATION: CWS geordi2q04 (1.22.106); FILE MERGED
2003/09/02 10:38:03 rt 1.22.106.1: #111934#: Join CWS sw7pp1.
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/layout/flylay.cxx79
1 files changed, 66 insertions, 13 deletions
diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx
index 4dccbb991e4b..1cef841bdfe5 100644
--- a/sw/source/core/layout/flylay.cxx
+++ b/sw/source/core/layout/flylay.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: flylay.cxx,v $
*
- * $Revision: 1.22 $
+ * $Revision: 1.23 $
*
- * last change: $Author: vg $ $Date: 2003-07-04 13:21:56 $
+ * last change: $Author: obo $ $Date: 2003-09-04 11:47:26 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -275,6 +275,44 @@ void SwFlyFreeFrm::MakeAll()
#endif
}
+/** determines, if direct environment of fly frame has 'auto' size
+
+ OD 07.08.2003 #i17297#, #111066#, #111070#
+ start with anchor frame and search via <GetUpper()> for a header, footer,
+ row or fly frame stopping at page frame.
+ return <true>, if such a frame is found and it has 'auto' size.
+ otherwise <false> is returned.
+
+ @author OD
+
+ @return boolean indicating, that direct environment has 'auto' size
+*/
+bool SwFlyFreeFrm::HasEnvironmentAutoSize() const
+{
+ bool bRetVal = false;
+
+ const SwFrm* pToBeCheckedFrm = GetAnchor();
+ while ( pToBeCheckedFrm &&
+ !pToBeCheckedFrm->IsPageFrm() )
+ {
+ if ( pToBeCheckedFrm->IsHeaderFrm() ||
+ pToBeCheckedFrm->IsFooterFrm() ||
+ pToBeCheckedFrm->IsRowFrm() ||
+ pToBeCheckedFrm->IsFlyFrm() )
+ {
+ bRetVal = ATT_FIX_SIZE !=
+ pToBeCheckedFrm->GetAttrSet()->GetFrmSize().GetSizeType();
+ break;
+ }
+ else
+ {
+ pToBeCheckedFrm = pToBeCheckedFrm->GetUpper();
+ }
+ }
+
+ return bRetVal;
+}
+
/*************************************************************************
|*
|* SwFlyFreeFrm::CheckClip()
@@ -374,7 +412,19 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
bWidthClipped = TRUE;
}
- if ( Lower() && Lower()->IsNoTxtFrm() && !FindFooterOrHeader() )
+ // OD 06.08.2003 #i17297#, #111066#, #111070# - no proportional
+ // scaling of graphics in environments, which determines its size
+ // by its content ('auto' size). Otherwise layout loops can occur and
+ // layout sizes of the environment can be incorrect.
+ // Such environment are:
+ // (1) header and footer frames with 'auto' size
+ // (2) table row frames with 'auto' size
+ // (3) fly frames with 'auto' size
+ // Note: section frames seems to be not critical - didn't found
+ // any critical layout situation so far.
+ if ( Lower() && Lower()->IsNoTxtFrm() &&
+ ( static_cast<SwCntntFrm*>(Lower())->GetNode()->GetOLENode() ||
+ !HasEnvironmentAutoSize() ) )
{
//Wenn Breite und Hoehe angepasst wurden, so ist die
//groessere Veraenderung massgeblich.
@@ -403,16 +453,19 @@ void SwFlyFreeFrm::CheckClip( const SwFmtFrmSize &rSz )
bWidthClipped = TRUE;
}
-// if( bWidthClipped || bHeightClipped )
-// {
-// SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
-// pFmt->LockModify();
-// SwFmtFrmSize aFrmSize( rSz );
-// aFrmSize.SetWidth( aFrmRect.Width() );
-// aFrmSize.SetHeight( aFrmRect.Height() );
-// pFmt->SetAttr( aFrmSize );
-// pFmt->UnlockModify();
-// }
+ // OD 07.08.2003 #i17297#, #111066#, #111070# - reactivate change
+ // of size attribute for fly frames containing an ole object.
+ if ( static_cast<SwCntntFrm*>(Lower())->GetNode()->GetOLENode() &&
+ ( bWidthClipped || bHeightClipped ) )
+ {
+ SwFlyFrmFmt *pFmt = (SwFlyFrmFmt*)GetFmt();
+ pFmt->LockModify();
+ SwFmtFrmSize aFrmSize( rSz );
+ aFrmSize.SetWidth( aFrmRect.Width() );
+ aFrmSize.SetHeight( aFrmRect.Height() );
+ pFmt->SetAttr( aFrmSize );
+ pFmt->UnlockModify();
+ }
}
//Jetzt die Einstellungen am Frm vornehmen, bei Spalten werden