ooo-build r12918 - in trunk: . patches/dev300



Author: freuter
Date: Wed Jun 18 10:22:14 2008
New Revision: 12918
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12918&view=rev

Log:
Fixes object positioning in tables (n#367341, i#18732)

Added:
   trunk/patches/dev300/sw-do-not-capture-surround-through-objs-patch.diff
Modified:
   trunk/ChangeLog
   trunk/patches/dev300/apply

Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply	(original)
+++ trunk/patches/dev300/apply	Wed Jun 18 10:22:14 2008
@@ -2195,6 +2195,8 @@
 
 sw-team-pane.diff
 
+sw-do-not-capture-surround-through-objs-patch.diff, n#367341, i#18732, flr
+
 [ Fixes ]
 cppcanvas-fix-roundcorners.diff, rodo
 slideshow-media-control.diff, thorsten

Added: trunk/patches/dev300/sw-do-not-capture-surround-through-objs-patch.diff
==============================================================================
--- (empty file)
+++ trunk/patches/dev300/sw-do-not-capture-surround-through-objs-patch.diff	Wed Jun 18 10:22:14 2008
@@ -0,0 +1,215 @@
+diff --git a/svx/source/msfilter/msdffimp.cxx b/svx/source/msfilter/msdffimp.cxx
+index ed542ee..8eae34f 100644
+--- svx/source/msfilter/msdffimp.cxx
++++ svx/source/msfilter/msdffimp.cxx
+@@ -7971,7 +7971,7 @@ SvxMSDffImportRec::SvxMSDffImportRec()
+       nXRelTo( 2 ), //   relative to column
+       nYAlign( 0 ), // position n cm below
+       nYRelTo( 2 ), //   relative to paragraph
+-      nLayoutInTableCell( 0 ), // element is laid out in table cell
++      nLayoutInTableCell( 0x00008000 ), // element is laid out in table cell
+       nTextRotationAngle( 0 ),
+       nDxTextLeft( 144 ),
+       nDyTextTop( 72 ),
+diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
+index 970d034..70d0e7e 100644
+--- sw/inc/IDocumentSettingAccess.hxx
++++ sw/inc/IDocumentSettingAccess.hxx
+@@ -84,6 +84,7 @@ namespace com { namespace sun { namespace star { namespace i18n { struct Forbidd
+          OUTLINE_LEVEL_YIELDS_OUTLINE_RULE,
+ 
+          DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
++	 DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS,
+          TABLE_ROW_KEEP,
+ 		 IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,
+          CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME,
+diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
+index 39a830f..6fef750 100644
+--- sw/inc/doc.hxx
++++ sw/inc/doc.hxx
+@@ -614,6 +614,7 @@ class SwDoc :
+     bool mbTableRowKeep                             : 1;   // FME 2006-02-10 #131283#
+     bool mbIgnoreTabsAndBlanksForLineCalculation    : 1;   // FME 2006-03-01 #i3952#
+     bool mbDoNotCaptureDrawObjsOnPage               : 1;   // OD 2006-03-14 #i62875#
++    bool mbDoNotCaptureSurroundThroughObjs          : 1;
+     bool mbOutlineLevelYieldsOutlineRule            : 1;
+     bool mbClipAsCharacterAnchoredWriterFlyFrames   : 1;   // OD 2006-04-13 #b6402800#
+     bool mbUnixForceZeroExtLeading                  : 1;   // FME 2006-10-09 #i60945#
+diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
+index b78b4be..ae03a12 100644
+--- sw/source/core/doc/doc.cxx
++++ sw/source/core/doc/doc.cxx
+@@ -294,6 +294,7 @@ bool SwDoc::get(/*[in]*/ DocumentSettingId id) const
+ 	    case TABLE_ROW_KEEP: return mbTableRowKeep;
+ 	    case IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION: return mbIgnoreTabsAndBlanksForLineCalculation;
+ 	    case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE: return mbDoNotCaptureDrawObjsOnPage;
++	    case DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS: return mbDoNotCaptureSurroundThroughObjs;
+         // --> OD 2006-08-25 #i68949#
+         case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME: return mbClipAsCharacterAnchoredWriterFlyFrames;
+         // <--
+@@ -400,6 +401,9 @@ void SwDoc::set(/*[in]*/ DocumentSettingId id, /*[in]*/ bool value)
+ 	    case DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE:
+ 		    mbDoNotCaptureDrawObjsOnPage = value;
+ 			break;
++	    case DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS:
++		    mbDoNotCaptureSurroundThroughObjs = value;
++			break;
+ 
+         // --> OD 2006-08-25 #i68949#
+         case CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME:
+diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
+index a90db25..d5041fd 100644
+--- sw/source/core/doc/docnew.cxx
++++ sw/source/core/doc/docnew.cxx
+@@ -415,6 +415,7 @@ SwDoc::SwDoc() :
+     mbTableRowKeep                          = false;        // hidden
+     mbIgnoreTabsAndBlanksForLineCalculation = false;        // hidden
+     mbDoNotCaptureDrawObjsOnPage            = false;        // hidden
++    mbDoNotCaptureSurroundThroughObjs       = false;        // hidden
+     mbClipAsCharacterAnchoredWriterFlyFrames= false;        // hidden
+     mbUnixForceZeroExtLeading               = false;        // hidden
+     mbOldPrinterMetrics                     = false;        // hidden
+diff --git a/sw/source/core/inc/anchoredobjectposition.hxx b/sw/source/core/inc/anchoredobjectposition.hxx
+index da60088..02e05bb 100644
+--- sw/source/core/inc/anchoredobjectposition.hxx
++++ sw/source/core/inc/anchoredobjectposition.hxx
+@@ -141,6 +141,11 @@ namespace objectpositioning
+             }
+             // <--
+ 
++	    inline const bool IsDoNotCaptureAnchoredObj() const
++	    {
++		return mbDoNotCaptureAnchoredObj;
++	    }
++
+          // virtual methods providing data for to character anchored objects.
+             virtual bool IsAnchoredToChar() const;
+             virtual const SwFrm* ToCharOrientFrm() const;
+diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
+index 2c6139e..721d644 100644
+--- sw/source/core/layout/tabfrm.cxx
++++ sw/source/core/layout/tabfrm.cxx
+@@ -4218,11 +4218,19 @@ long MA_FASTCALL CalcHeightWidthFlys( const SwFrm *pFrm )
+                     // OD 30.09.2003 #i18732# - only objects, which follow
+                     // the text flow have to be considered.
+                     const SwFrmFmt& rFrmFmt = pAnchoredObj->GetFrmFmt();
+-                    const bool bConsiderObj =
++                    bool bConsiderObj =
+                             rFrmFmt.GetAnchor().GetAnchorId() != FLY_IN_CNTNT &&
+                             pAnchoredObj->GetObjRect().Top() != WEIT_WECH &&
+                             rFrmFmt.GetFollowTextFlow().GetValue() &&
+                             pAnchoredObj->GetPageFrm() == pTmp->FindPageFrm();
++		    if (bConsiderObj && rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE)) {
++			bConsiderObj=false;
++		    }
++		    if (bConsiderObj && rFrmFmt.GetSurround().GetSurround()==SURROUND_THROUGHT
++			&& rFrmFmt.getIDocumentSettingAccess()->get(IDocumentSettingAccess::DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS)) {
++			bConsiderObj=false;
++		    }
++
+                     if ( bConsiderObj )
+ 					{
+                         const SwFmtFrmSize &rSz = rFrmFmt.GetFrmSize();
+diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+index 566dd25..26b19b6 100644
+--- sw/source/core/objectpositioning/anchoredobjectposition.cxx
++++ sw/source/core/objectpositioning/anchoredobjectposition.cxx
+@@ -89,6 +89,8 @@
+ #include <IDocumentSettingAccess.hxx>
+ #endif
+ 
++#include <fmtsrnd.hxx>
++
+ using namespace ::com::sun::star;
+ using namespace objectpositioning;
+ 
+@@ -181,6 +183,10 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj()
+     {
+         mbDoNotCaptureAnchoredObj = !mbIsObjFly && !mbFollowTextFlow &&
+                                     mpFrmFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE);
++	if (mpFrmFmt->GetSurround().GetSurround()==SURROUND_THROUGHT
++	    && mpFrmFmt->getIDocumentSettingAccess()->get(IDocumentSettingAccess::DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS)) {
++	    mbDoNotCaptureAnchoredObj = true; 
++	}
+     }
+     // <--
+ }
+diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+index 16a5cb0..27c9626 100644
+--- sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
++++ sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx
+@@ -227,9 +227,10 @@ void SwToCntntAnchoredObjectPosition::CalcPosition()
+     SwEnvironmentOfAnchoredObject aEnvOfObj( DoesObjFollowsTextFlow() );
+ 
+     // OD 30.09.2003 #i18732# - grow only, if object has to follow the text flow
+-    const bool bGrow = DoesObjFollowsTextFlow() &&
++    bool bGrow = DoesObjFollowsTextFlow() &&
+                        ( !GetAnchorFrm().IsInTab() ||
+-                         !rFrmFmt.GetFrmSize().GetHeightPercent() );
++                         !rFrmFmt.GetFrmSize().GetHeightPercent() )
++	               && !IsDoNotCaptureAnchoredObj();
+ 
+     // get text frame the object is anchored at
+     const SwTxtFrm& rAnchorTxtFrm = GetAnchorTxtFrm();
+diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
+index 3efd02d..0333827 100644
+--- sw/source/filter/ww8/ww8graf.cxx
++++ sw/source/filter/ww8/ww8graf.cxx
+@@ -2789,10 +2789,11 @@ SwFrmFmt* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp )
+     // Switch on 'follow text flow',
+     // if object is laid out inside table cell and
+     // its wrapping isn't 'SURROUND_THROUGH'
+-    if (bLayoutInTableCell && eSurround != SURROUND_THROUGHT)
++    if (bLayoutInTableCell /*&& eSurround != SURROUND_THROUGHT*/)
+     {
+         SwFmtFollowTextFlow aFollowTextFlow( TRUE );
+         aFlySet.Put( aFollowTextFlow );
++	rDoc.set(IDocumentSettingAccess::DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS, 1);
+     }
+ 
+ 
+diff --git a/sw/source/ui/uno/SwXDocumentSettings.cxx b/sw/source/ui/uno/SwXDocumentSettings.cxx
+index da571a3..13689ae 100644
+--- sw/source/ui/uno/SwXDocumentSettings.cxx
++++ sw/source/ui/uno/SwXDocumentSettings.cxx
+@@ -157,6 +157,7 @@ enum SwDocumentSettingsPropertyHandles
+     HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,
+     HANDLE_LOAD_READONLY,
+     HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE,
++    HANDLE_DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS,
+     HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES,
+     HANDLE_UNIX_FORCE_ZERO_EXT_LEADING,
+     HANDLE_USE_OLD_PRINTER_METRICS,
+@@ -208,6 +209,7 @@ MasterPropertySetInfo * lcl_createSettingsInfo()
+         { RTL_CONSTASCII_STRINGPARAM("IgnoreTabsAndBlanksForLineCalculation"),   HANDLE_IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION,         CPPUTYPE_BOOLEAN,           0,   0},
+         { RTL_CONSTASCII_STRINGPARAM("LoadReadonly"),               HANDLE_LOAD_READONLY,                   CPPUTYPE_BOOLEAN,           0,   0},
+         { RTL_CONSTASCII_STRINGPARAM("DoNotCaptureDrawObjsOnPage"),   HANDLE_DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, CPPUTYPE_BOOLEAN, 0, 0},
++	{ RTL_CONSTASCII_STRINGPARAM("DoNotCaptureSurroundThroughObjs"),   HANDLE_DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS, CPPUTYPE_BOOLEAN, 0, 0},
+         { RTL_CONSTASCII_STRINGPARAM("ClipAsCharacterAnchoredWriterFlyFrames"), HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES, CPPUTYPE_BOOLEAN, 0, 0},
+         { RTL_CONSTASCII_STRINGPARAM("UnxForceZeroExtLeading"), HANDLE_UNIX_FORCE_ZERO_EXT_LEADING, CPPUTYPE_BOOLEAN, 0, 0},
+         { RTL_CONSTASCII_STRINGPARAM("UseOldPrinterMetrics"), HANDLE_USE_OLD_PRINTER_METRICS, CPPUTYPE_BOOLEAN, 0, 0},
+@@ -668,6 +670,11 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
+             sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
+             mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, bTmp);
+         }
++        case HANDLE_DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS:
++        {
++            sal_Bool bTmp = *(sal_Bool*)rValue.getValue();
++            mpDoc->set(IDocumentSettingAccess::DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS, bTmp);
++        }
+         break;
+         case HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES:
+         {
+@@ -974,6 +981,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
+             rValue.setValue( &bTmp, ::getBooleanCppuType() );
+         }
+         break;
++	case HANDLE_DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS:
++        {
++            sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::DO_NOT_CAPTURE_SURROUND_THROUGH_OBJS);
++            rValue.setValue( &bTmp, ::getBooleanCppuType() );
++        }
++        break;
+         case HANDLE_CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAMES:
+         {
+             sal_Bool bTmp = mpDoc->get(IDocumentSettingAccess::CLIP_AS_CHARACTER_ANCHORED_WRITER_FLY_FRAME);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]