summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/objectformattertxtfrm.cxx
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2004-12-23 09:08:49 +0000
committerVladimir Glazounov <vg@openoffice.org>2004-12-23 09:08:49 +0000
commit277fe2a69f322ff6d6f53ec88d739d49a1c466e4 (patch)
tree744e75e868e8e01874f1ff43a417c72389171402 /sw/source/core/layout/objectformattertxtfrm.cxx
parentf9bed057e4ae2614f8139ff22d0b45c96221a093 (diff)
INTEGRATION: CWS swqbugfixes10 (1.5.4); FILE MERGED
2004/12/07 09:22:06 od 1.5.4.2: RESYNC: (1.5-1.6); FILE MERGED 2004/12/03 15:42:32 od 1.5.4.1: #115759# - avoid follow format, if it's not needed.
Diffstat (limited to 'sw/source/core/layout/objectformattertxtfrm.cxx')
-rw-r--r--sw/source/core/layout/objectformattertxtfrm.cxx47
1 files changed, 42 insertions, 5 deletions
diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx
index 89578021cba2..740dd84a4a25 100644
--- a/sw/source/core/layout/objectformattertxtfrm.cxx
+++ b/sw/source/core/layout/objectformattertxtfrm.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: objectformattertxtfrm.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: rt $ $Date: 2004-11-26 13:25:50 $
+ * last change: $Author: vg $ $Date: 2004-12-23 10:08:49 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,7 +61,6 @@
#ifndef _OBJECTFORMATTERTXTFRM_HXX
#include <objectformattertxtfrm.hxx>
#endif
-
#ifndef _ANCHOREDOBJECT_HXX
#include <anchoredobject.hxx>
#endif
@@ -105,6 +104,32 @@
#include <layact.hxx>
#endif
+// --> OD 2004-12-03 #115759# - little helper class to forbid follow formatting
+// for the given text frame
+class SwForbidFollowFormat
+{
+private:
+ SwTxtFrm& mrTxtFrm;
+ const bool bOldFollowFormatAllowed;
+
+public:
+ SwForbidFollowFormat( SwTxtFrm& _rTxtFrm )
+ : mrTxtFrm( _rTxtFrm ),
+ bOldFollowFormatAllowed( _rTxtFrm.FollowFormatAllowed() )
+ {
+ mrTxtFrm.ForbidFollowFormat();
+ }
+
+ ~SwForbidFollowFormat()
+ {
+ if ( bOldFollowFormatAllowed )
+ {
+ mrTxtFrm.AllowFollowFormat();
+ }
+ }
+};
+// <--
+
// =============================================================================
// implementation of class <SwObjectFormatterTxtFrm>
// =============================================================================
@@ -215,7 +240,13 @@ bool SwObjectFormatterTxtFrm::DoFormatObj( SwAnchoredObject& _rAnchoredObj )
// determine, if anchor text frame has previous frame
const bool bDoesAnchorHadPrev = ( mrAnchorTxtFrm.GetIndPrev() != 0 );
- mrAnchorTxtFrm.Calc();
+ // --> OD 2004-12-03 #115759# - optimization:
+ // format of follow not needed. Thus, forbid it.
+ {
+ SwForbidFollowFormat aForbidFollowFormat( mrAnchorTxtFrm );
+ mrAnchorTxtFrm.Calc();
+ }
+ // <--
// --> OD 2004-10-22 #i35911#
if ( _rAnchoredObj.HasClearedEnvironment() )
@@ -331,7 +362,13 @@ bool SwObjectFormatterTxtFrm::DoFormatObjs()
// previous frames of the anchor frame. The format of the previous
// frames is needed to get a correct result of format of the
// anchor frame for the following check for moved forward anchors
- mrAnchorTxtFrm.Calc();
+ // --> OD 2004-12-03 #115759# - optimization:
+ // format of follow not needed. Thus, forbid it.
+ {
+ SwForbidFollowFormat aForbidFollowFormat( mrAnchorTxtFrm );
+ mrAnchorTxtFrm.Calc();
+ }
+ // <--
sal_uInt32 nToPageNum( 0L );
SwAnchoredObject* pObj = 0L;