[ooo-build-commit] Branch 'ooo-build-3-1-1' - patches/dev300

Petr Mladek pmladek at kemper.freedesktop.org
Thu Aug 27 01:47:39 PDT 2009


 patches/dev300/ww8-image-position.diff |  191 +++++++++++++++++++--------------
 1 file changed, 112 insertions(+), 79 deletions(-)

New commits:
commit 711903164342aac0af8303852cadc5b54283f49b
Author: Petr Mladek <pmladek at suse.cz>
Date:   Thu Aug 27 10:46:14 2009 +0200

    Updated ww8 image position import fix by Fridrich (bnc#532920)
    
    * patches/dev300/ww8-image-position.diff: fixed build on Windows with older boost; fixed one
      potential crasher; changes by Fridrich (bnc#532920)

diff --git a/patches/dev300/ww8-image-position.diff b/patches/dev300/ww8-image-position.diff
index 12ca4ab..7c56392 100644
--- a/patches/dev300/ww8-image-position.diff
+++ b/patches/dev300/ww8-image-position.diff
@@ -1,7 +1,5 @@
-diff --git svx/inc/svx/msdffimp.hxx svx/inc/svx/msdffimp.hxx
-index b03e242..0cd6327 100644
---- svx/inc/svx/msdffimp.hxx
-+++ svx/inc/svx/msdffimp.hxx
+--- svx/inc/svx/msdffimp.hxx	2009-08-26 16:20:59.296875000 +0200
++++ svx/inc/svx/msdffimp.hxx	2009-08-26 16:26:13.703125000 +0200
 @@ -50,6 +50,8 @@
  
  #include <sot/storage.hxx>
@@ -15,27 +13,37 @@ index b03e242..0cd6327 100644
  
  struct SVX_DLLPUBLIC SvxMSDffImportRec
  {
-+    static const int RELTO_DEFAULT = 2;
++	static const int RELTO_DEFAULT = 2;
 +
-     SdrObject*	pObj;
-     Polygon*	pWrapPolygon;
-     char*		pClientAnchorBuffer;
+ 	SdrObject*	pObj;
+ 	Polygon*	pWrapPolygon;
+ 	char*		pClientAnchorBuffer;
 @@ -177,9 +181,9 @@ struct SVX_DLLPUBLIC SvxMSDffImportRec
-     char*		pClientDataBuffer;
-     UINT32		nClientDataLen;
-     UINT32		nXAlign;
+ 	char*		pClientDataBuffer;
+ 	UINT32		nClientDataLen;
+ 	UINT32		nXAlign;
 -    UINT32		nXRelTo;
 +    boost::optional< UINT32 >		nXRelTo;
-     UINT32		nYAlign;
+ 	UINT32		nYAlign;
 -    UINT32		nYRelTo;
 +    boost::optional< UINT32	>    	nYRelTo;
-     UINT32		nLayoutInTableCell;
+ 	UINT32		nLayoutInTableCell;
      UINT32      nFlags;
-     long		nTextRotationAngle;
-diff --git svx/source/msfilter/msdffimp.cxx svx/source/msfilter/msdffimp.cxx
-index 74582fa..f21d1d2 100644
---- svx/source/msfilter/msdffimp.cxx
-+++ svx/source/msfilter/msdffimp.cxx
+ 	long		nTextRotationAngle;
+--- svx/source/msfilter/msdffimp.cxx	2009-08-26 16:21:11.265625000 +0200
++++ svx/source/msfilter/msdffimp.cxx	2009-08-26 16:28:45.265625000 +0200
+@@ -5438,9 +5438,9 @@ SdrObject* SvxMSDffManager::ProcessObj(S
+ 				switch( nPID )
+ 				{
+ 					case 0x038F: pImpRec->nXAlign = nUDData; break;
+-					case 0x0390: pImpRec->nXRelTo = nUDData; break;
++					case 0x0390: pImpRec->nXRelTo.reset(nUDData); break;
+ 					case 0x0391: pImpRec->nYAlign = nUDData; break;
+-					case 0x0392: pImpRec->nYRelTo = nUDData; break;
++					case 0x0392: pImpRec->nYRelTo.reset(nUDData); break;
+                     case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ 				}
+ 				if ( rSt.GetError() != 0 )
 @@ -7857,9 +7857,9 @@ SvxMSDffImportRec::SvxMSDffImportRec()
        pClientDataBuffer( 0 ),
        nClientDataLen(    0 ),
@@ -48,18 +56,16 @@ index 74582fa..f21d1d2 100644
        nLayoutInTableCell( 0 ), // element is laid out in table cell
        nTextRotationAngle( 0 ),
        nDxTextLeft( 144 ),
-diff --git sw/source/filter/docx/docx-ww8graf.cxx sw/source/filter/docx/docx-ww8graf.cxx
-index 6fdafff..cc2d3d0 100644
---- sw/source/filter/docx/docx-ww8graf.cxx
-+++ sw/source/filter/docx/docx-ww8graf.cxx
-@@ -1958,11 +1958,17 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
+--- sw/source/filter/docx/docx-ww8graf.cxx	2009-08-26 16:16:37.187500000 +0200
++++ sw/source/filter/docx/docx-ww8graf.cxx	2009-08-26 22:31:35.109375000 +0200
+@@ -1958,11 +1958,17 @@ void SwWW8ImplReader::MatchSdrItemsIntoF
  void SwWW8ImplReader::AdjustLRWrapForWordMargins(
      const SvxMSDffImportRec &rRecord, SvxLRSpaceItem &rLR)
  {
 +    UINT32 nXRelTo = SvxMSDffImportRec::RELTO_DEFAULT;
 +    if ( !!rRecord.nXRelTo )
 +    {
-+        nXRelTo = rRecord.nXRelTo.get( );
++        nXRelTo = *rRecord.nXRelTo.get( );
 +    }
 +
      // Left adjustments - if horizontally aligned to left of
@@ -71,7 +77,7 @@ index 6fdafff..cc2d3d0 100644
              rLR.SetLeft((USHORT)0);
      }
  
-@@ -1970,18 +1976,18 @@ void SwWW8ImplReader::AdjustLRWrapForWordMargins(
+@@ -1970,18 +1976,18 @@ void SwWW8ImplReader::AdjustLRWrapForWor
      // margin or column then remove the right wrapping
      if (rRecord.nXAlign == 3)
      {
@@ -93,14 +99,14 @@ index 6fdafff..cc2d3d0 100644
      {
          rLR.SetRight((USHORT)0);
      }
-@@ -1991,11 +1997,17 @@ void SwWW8ImplReader::AdjustLRWrapForWordMargins(
+@@ -1991,11 +1997,17 @@ void SwWW8ImplReader::AdjustLRWrapForWor
  void SwWW8ImplReader::AdjustULWrapForWordMargins(
      const SvxMSDffImportRec &rRecord, SvxULSpaceItem &rUL)
  {
 +    UINT32 nYRelTo = SvxMSDffImportRec::RELTO_DEFAULT;
 +    if ( !!rRecord.nYRelTo )
 +    {
-+        nYRelTo = rRecord.nYRelTo.get( );
++        nYRelTo = *rRecord.nYRelTo.get( );
 +    }
 +    
      // Top adjustment - remove upper wrapping if aligned to page
@@ -112,7 +118,7 @@ index 6fdafff..cc2d3d0 100644
              rUL.SetUpper((USHORT)0);
      }
  
-@@ -2003,12 +2015,12 @@ void SwWW8ImplReader::AdjustULWrapForWordMargins(
+@@ -2003,12 +2015,12 @@ void SwWW8ImplReader::AdjustULWrapForWor
      // printable area or to page
      if (rRecord.nYAlign == 3)
      {
@@ -127,59 +133,71 @@ index 6fdafff..cc2d3d0 100644
          rUL.SetUpper((USHORT)0);
  
      /*
-@@ -2250,10 +2262,15 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
-         return FLY_PAGE;
+@@ -2251,11 +2263,11 @@ RndStdIds SwWW8ImplReader::ProcessEscher
  
      SvxMSDffImportRec aRecordFromFSPA;
--    if (!pRecord)
-+    if (!pRecord->nXRelTo)
-     {
+     if (!pRecord)
+-    {
          pRecord = &aRecordFromFSPA;
-         pRecord->nXRelTo = pFSPA->nbx;
-+    }
-+
-+    if (!pRecord->nYRelTo)
-+    {
-+        pRecord = &aRecordFromFSPA;
-         pRecord->nYRelTo = pFSPA->nby;
-     }
+-        pRecord->nXRelTo = pFSPA->nbx;
+-        pRecord->nYRelTo = pFSPA->nby;
+-    }
++    if (!pRecord->nXRelTo && pFSPA)
++        pRecord->nXRelTo.reset(pFSPA->nbx);
++    if (!pRecord->nYRelTo && pFSPA)
++        pRecord->nYRelTo.reset(pFSPA->nby);
  
-@@ -2283,10 +2300,10 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
+     // nXAlign - abs. Position, Left,  Centered,  Right,  Inside, Outside
+     // nYAlign - abs. Position, Top,   Centered,  Bottom, Inside, Outside
+@@ -2283,19 +2295,19 @@ RndStdIds SwWW8ImplReader::ProcessEscher
          // is a hint that these values aren't set by the escher import - see
          // method <SwMSDffManager::ProcessObj(..)>. Then, check if for each
          // values, if it differs from the one in the FSPA.
 -        if ( pRecord->nXRelTo == 2 && pRecord->nYRelTo == 2 )
-+        if ( pRecord->nXRelTo.get( ) == 2 && pRecord->nYRelTo.get( ) == 2 )
++        if ( *pRecord->nXRelTo.get( ) == 2 && *pRecord->nYRelTo.get( ) == 2 )
          {
              // if <nYRelTo> differs from <FSPA.nby> overwrite <nYRelTo>
 -            if ( pFSPA->nby != pRecord->nYRelTo )
-+            if ( pFSPA->nby != pRecord->nYRelTo.get( ) )
++            if ( pFSPA->nby != *pRecord->nYRelTo.get( ) )
              {
-                 pRecord->nYRelTo = pFSPA->nby;
+-                pRecord->nYRelTo = pFSPA->nby;
++                pRecord->nYRelTo.reset(pFSPA->nby);
              }
-@@ -2294,8 +2311,8 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
+         }
          // <--
  	}
  
 -    UINT32 nXRelTo = nCntRelTo > pRecord->nXRelTo ? pRecord->nXRelTo : 1;
 -    UINT32 nYRelTo = nCntRelTo > pRecord->nYRelTo ? pRecord->nYRelTo : 1;
-+    UINT32 nXRelTo = nCntRelTo > pRecord->nXRelTo.get( ) ? pRecord->nXRelTo.get( ) : 1;
-+    UINT32 nYRelTo = nCntRelTo > pRecord->nYRelTo.get( ) ? pRecord->nYRelTo.get( ) : 1;
++    UINT32 nXRelTo = nCntRelTo > *pRecord->nXRelTo.get( ) ? *pRecord->nXRelTo.get( ) : 1;
++    UINT32 nYRelTo = nCntRelTo > *pRecord->nYRelTo.get( ) ? *pRecord->nYRelTo.get( ) : 1;
  
      // --> OD 2005-03-03 #i43718#
      RndStdIds eAnchor = IsInlineEscherHack() ? FLY_IN_CNTNT : FLY_AUTO_CNTNT;
-diff --git sw/source/filter/ww8/ww8graf.cxx sw/source/filter/ww8/ww8graf.cxx
-index 4948ac5..d6983ca 100644
---- sw/source/filter/ww8/ww8graf.cxx
-+++ sw/source/filter/ww8/ww8graf.cxx
-@@ -1958,11 +1958,17 @@ void SwWW8ImplReader::MatchSdrItemsIntoFlySet( SdrObject* pSdrObj,
+--- sw/source/filter/docx/docx-ww8par.cxx	2009-08-26 16:16:37.203125000 +0200
++++ sw/source/filter/docx/docx-ww8par.cxx	2009-08-26 16:51:32.640625000 +0200
+@@ -320,9 +320,9 @@ SdrObject* SwMSDffManager::ProcessObj(Sv
+ 				switch( nPID )
+ 				{
+ 					case 0x038F: pImpRec->nXAlign = nUDData; break;
+-					case 0x0390: pImpRec->nXRelTo = nUDData; break;
++					case 0x0390: pImpRec->nXRelTo.reset(nUDData); break;
+ 					case 0x0391: pImpRec->nYAlign = nUDData; break;
+-					case 0x0392: pImpRec->nYRelTo = nUDData; break;
++					case 0x0392: pImpRec->nYRelTo.reset(nUDData); break;
+                     case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ 				}
+ 				if ( rSt.GetError() != 0 )
+--- sw/source/filter/ww8/ww8graf.cxx	2009-08-26 16:16:37.921875000 +0200
++++ sw/source/filter/ww8/ww8graf.cxx	2009-08-26 22:32:01.453125000 +0200
+@@ -1958,11 +1958,17 @@ void SwWW8ImplReader::MatchSdrItemsIntoF
  void SwWW8ImplReader::AdjustLRWrapForWordMargins(
      const SvxMSDffImportRec &rRecord, SvxLRSpaceItem &rLR)
  {
 +    UINT32 nXRelTo = SvxMSDffImportRec::RELTO_DEFAULT;
 +    if ( !!rRecord.nXRelTo )
 +    {
-+        nXRelTo = rRecord.nXRelTo.get( );
++        nXRelTo = *rRecord.nXRelTo.get( );
 +    }
 +
      // Left adjustments - if horizontally aligned to left of
@@ -191,7 +209,7 @@ index 4948ac5..d6983ca 100644
              rLR.SetLeft((USHORT)0);
      }
  
-@@ -1970,18 +1976,18 @@ void SwWW8ImplReader::AdjustLRWrapForWordMargins(
+@@ -1970,18 +1976,18 @@ void SwWW8ImplReader::AdjustLRWrapForWor
      // margin or column then remove the right wrapping
      if (rRecord.nXAlign == 3)
      {
@@ -213,14 +231,14 @@ index 4948ac5..d6983ca 100644
      {
          rLR.SetRight((USHORT)0);
      }
-@@ -1991,11 +1997,17 @@ void SwWW8ImplReader::AdjustLRWrapForWordMargins(
+@@ -1991,11 +1997,17 @@ void SwWW8ImplReader::AdjustLRWrapForWor
  void SwWW8ImplReader::AdjustULWrapForWordMargins(
      const SvxMSDffImportRec &rRecord, SvxULSpaceItem &rUL)
  {
 +    UINT32 nYRelTo = SvxMSDffImportRec::RELTO_DEFAULT;
 +    if ( !!rRecord.nYRelTo )
 +    {
-+        nYRelTo = rRecord.nYRelTo.get( );
++        nYRelTo = *rRecord.nYRelTo.get( );
 +    }
 +
      // Top adjustment - remove upper wrapping if aligned to page
@@ -232,7 +250,7 @@ index 4948ac5..d6983ca 100644
              rUL.SetUpper((USHORT)0);
      }
  
-@@ -2003,12 +2015,12 @@ void SwWW8ImplReader::AdjustULWrapForWordMargins(
+@@ -2003,12 +2015,12 @@ void SwWW8ImplReader::AdjustULWrapForWor
      // printable area or to page
      if (rRecord.nYAlign == 3)
      {
@@ -247,44 +265,59 @@ index 4948ac5..d6983ca 100644
          rUL.SetUpper((USHORT)0);
  
      /*
-@@ -2250,10 +2262,15 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
-         return FLY_PAGE;
+@@ -2251,11 +2263,11 @@ RndStdIds SwWW8ImplReader::ProcessEscher
  
      SvxMSDffImportRec aRecordFromFSPA;
--    if (!pRecord)
-+    if (!pRecord->nXRelTo)
-     {
+     if (!pRecord)
+-    {
          pRecord = &aRecordFromFSPA;
-         pRecord->nXRelTo = pFSPA->nbx;
-+    }
-+
-+    if (!pRecord->nYRelTo)
-+    {
-+        pRecord = &aRecordFromFSPA;
-         pRecord->nYRelTo = pFSPA->nby;
-     }
+-        pRecord->nXRelTo = pFSPA->nbx;
+-        pRecord->nYRelTo = pFSPA->nby;
+-    }
++    if (!pRecord->nXRelTo && pFSPA)
++        pRecord->nXRelTo.reset(pFSPA->nbx);
++    if (!pRecord->nYRelTo && pFSPA)
++        pRecord->nYRelTo.reset(pFSPA->nby);
  
-@@ -2283,10 +2300,10 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
+     // nXAlign - abs. Position, Left,  Centered,  Right,  Inside, Outside
+     // nYAlign - abs. Position, Top,   Centered,  Bottom, Inside, Outside
+@@ -2283,19 +2295,19 @@ RndStdIds SwWW8ImplReader::ProcessEscher
          // is a hint that these values aren't set by the escher import - see
          // method <SwMSDffManager::ProcessObj(..)>. Then, check if for each
          // values, if it differs from the one in the FSPA.
 -        if ( pRecord->nXRelTo == 2 && pRecord->nYRelTo == 2 )
-+        if ( pRecord->nXRelTo.get( ) == 2 && pRecord->nYRelTo.get( ) == 2 )
++        if ( *pRecord->nXRelTo.get( ) == 2 && *pRecord->nYRelTo.get( ) == 2 )
          {
              // if <nYRelTo> differs from <FSPA.nby> overwrite <nYRelTo>
 -            if ( pFSPA->nby != pRecord->nYRelTo )
-+            if ( pFSPA->nby != pRecord->nYRelTo.get( ) )
++            if ( pFSPA->nby != *pRecord->nYRelTo.get( ) )
              {
-                 pRecord->nYRelTo = pFSPA->nby;
+-                pRecord->nYRelTo = pFSPA->nby;
++                pRecord->nYRelTo.reset(pFSPA->nby);
              }
-@@ -2294,8 +2311,8 @@ RndStdIds SwWW8ImplReader::ProcessEscherAlign(SvxMSDffImportRec* pRecord,
+         }
          // <--
-     }
+ 	}
  
 -    UINT32 nXRelTo = nCntRelTo > pRecord->nXRelTo ? pRecord->nXRelTo : 1;
 -    UINT32 nYRelTo = nCntRelTo > pRecord->nYRelTo ? pRecord->nYRelTo : 1;
-+    UINT32 nXRelTo = nCntRelTo > pRecord->nXRelTo.get( ) ? pRecord->nXRelTo.get( ) : 1;
-+    UINT32 nYRelTo = nCntRelTo > pRecord->nYRelTo.get( ) ? pRecord->nYRelTo.get( ) : 1;
++    UINT32 nXRelTo = nCntRelTo > *pRecord->nXRelTo.get( ) ? *pRecord->nXRelTo.get( ) : 1;
++    UINT32 nYRelTo = nCntRelTo > *pRecord->nYRelTo.get( ) ? *pRecord->nYRelTo.get( ) : 1;
  
      // --> OD 2005-03-03 #i43718#
      RndStdIds eAnchor = IsInlineEscherHack() ? FLY_IN_CNTNT : FLY_AUTO_CNTNT;
+Only in sw/source/filter/ww8: ww8graf.cxx
+--- sw/source/filter/ww8/ww8par.cxx	2009-08-26 16:16:37.937500000 +0200
++++ sw/source/filter/ww8/ww8par.cxx	2009-08-26 16:43:09.906250000 +0200
+@@ -471,9 +471,9 @@ SdrObject* SwMSDffManager::ProcessObj(Sv
+ 				switch( nPID )
+ 				{
+ 					case 0x038F: pImpRec->nXAlign = nUDData; break;
+-					case 0x0390: pImpRec->nXRelTo = nUDData; break;
++					case 0x0390: pImpRec->nXRelTo.reset(nUDData); break;
+ 					case 0x0391: pImpRec->nYAlign = nUDData; break;
+-					case 0x0392: pImpRec->nYRelTo = nUDData; break;
++					case 0x0392: pImpRec->nYRelTo.reset(nUDData); break;
+                     case 0x03BF: pImpRec->nLayoutInTableCell = nUDData; break;
+ 				}
+ 				if ( rSt.GetError() != 0 )


More information about the ooo-build-commit mailing list