openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msei...@apache.org
Subject svn commit: r1843062 - in /openoffice/branches/AOO416: ./ main/ main/filter/ main/filter/inc/filter/msfilter/msdffimp.hxx main/filter/source/msfilter/msdffimp.cxx
Date Sun, 07 Oct 2018 12:30:02 GMT
Author: mseidel
Date: Sun Oct  7 12:30:02 2018
New Revision: 1843062

URL: http://svn.apache.org/viewvc?rev=1843062&view=rev
Log:
i127873 - Merge r1838291 from trunk

Ignore the SP_FGROUP flag on shape records.  Instead assume that the
first shape in a shape group is the group shape.  Add a new flag
parameter to SvxMSDffManager::ImportShape() to indicate the whether
or not this is a group shape based on the calling context.  Call
SvxMSDffManager::ImportShape() directly from SvxMSDffManager::ImportGroup()
instead of indirectly via SvxMSDffManager::ImportObj() to facilitate
passing the context information.
 Don't call SvxMSDffManager::ProcessObj() from SvxMSDffManager::ImportShape()
when processing a group shape.  SvxMSDffManager::ImportObj() expects
SvxMSDffManager::ImportShape() to return a pointer to an SdrObjGroup
object in this case, and SvxMSDffManager::ProcessObj() may replace
the SdrObjGroup object with some other type of shape object.
 Change some C-style SdrObjGroup* casts to dynamic_cast so that incorrect
casts will create a NULL pointer and fail quickly rather than executing
methods on an object of the wrong type and doing something possibly
undefined.

Submitted by: truckman

Modified:
    openoffice/branches/AOO416/   (props changed)
    openoffice/branches/AOO416/main/   (props changed)
    openoffice/branches/AOO416/main/filter/   (props changed)
    openoffice/branches/AOO416/main/filter/inc/filter/msfilter/msdffimp.hxx
    openoffice/branches/AOO416/main/filter/source/msfilter/msdffimp.cxx

Propchange: openoffice/branches/AOO416/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct  7 12:30:02 2018
@@ -2,5 +2,5 @@
 /openoffice/branches/ia2:1417739-1541842
 /openoffice/branches/ooxml-osba:1546391,1546395,1546574,1546934,1547030,1547392,1551920,1551954,1551958,1552283
 /openoffice/branches/rejuvenate01:1480411,1534063,1534098,1536312,1549902,1560617
-/openoffice/trunk:1571617,1571619,1571677,1572577,1572587,1573547,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585171,1585261,1586242,1586249,1586583,1587468,1589050,1591501,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602791,1602823,1602850,1603416,1603897,1604709,1604786,1605044,1605355,1605689,1606055,1606061,1607111,1607793,1607836,1608348,1608359,1608376,1608730,1608733,1609204,1609208,1609302,1609426,1610347,1610411,1610422,1610671,1611549,1612539,1612801,1621121,1623847,1623849-1623850,1642300-1642302,1647713,1652476,1654282,1668939,1669457,1669459,1669462-1669463,1669465,1689883,1689959,1690740,1690755,1690854,1694131-1694132,1694701,1702894,1702898,1702986,1702988,1705542-1705543,1705551,1706649,1707397,1707659,1723875,1729921,1730154,174
 8497,1755873,1758150,1760461,1761439,1763017,1763019,1765170,1766467,1766530,1766915,1780015,1784925,1784961,1785175,1791815,1793216,1797494,1800077,1800568,1802428,1803787,1803939,1804182,1805208,1806314,1811013,1811435,1811737,1813450,1814994,1815700,1839130
+/openoffice/trunk:1571617,1571619,1571677,1572577,1572587,1573547,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585171,1585261,1586242,1586249,1586583,1587468,1589050,1591501,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602791,1602823,1602850,1603416,1603897,1604709,1604786,1605044,1605355,1605689,1606055,1606061,1607111,1607793,1607836,1608348,1608359,1608376,1608730,1608733,1609204,1609208,1609302,1609426,1610347,1610411,1610422,1610671,1611549,1612539,1612801,1621121,1623847,1623849-1623850,1642300-1642302,1647713,1652476,1654282,1668939,1669457,1669459,1669462-1669463,1669465,1689883,1689959,1690740,1690755,1690854,1694131-1694132,1694701,1702894,1702898,1702986,1702988,1705542-1705543,1705551,1706649,1707397,1707659,1723875,1729921,1730154,174
 8497,1755873,1758150,1760461,1761439,1763017,1763019,1765170,1766467,1766530,1766915,1780015,1784925,1784961,1785175,1791815,1793216,1797494,1800077,1800568,1802428,1803787,1803939,1804182,1805208,1806314,1811013,1811435,1811737,1813450,1814994,1815700,1838291-1838292,1839130
 /openoffice/trunk/main:1705369

Propchange: openoffice/branches/AOO416/main/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct  7 12:30:02 2018
@@ -2,4 +2,4 @@
 /openoffice/branches/ia2/main:1417739-1541842
 /openoffice/branches/ooxml-osba/main:1546391,1546395,1546574,1546934,1547030,1547392,1551920,1551954,1551958,1552283
 /openoffice/branches/rejuvenate01/main:1480411,1534063,1534098,1536312,1549902,1560617
-/openoffice/trunk/main:1571617,1571677,1572569,1572577,1573547,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585171,1585261,1586242,1586249,1586583,1587468,1589050,1591501,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602791,1602823,1602850,1603416,1603897,1603941,1604028,1604709,1604786,1605044,1605355,1605689,1606055,1606061,1606706,1607111,1607793,1607836,1608348,1608376,1608730,1608733,1609204,1609208,1609302,1609426,1610347,1610411,1610422,1610671,1611470,1611549,1612070-1612071,1612539,1612801,1616457,1616944,1620195,1621121,1623847,1623849-1623850,1630814,1633294,1633297,1635806,1642300-1642302,1643177,1650314,1652476,1654282,1668939,1669457,1669459,1669462-1669463,1669465,1677190,1687177,1689883,1689959,1692551,1694132,1694701,1695962,169780
 7,1700078,1700126,1700135,1702107,1702894,1702898,1702986,1702988,1705193,1705196,1705199,1705276,1705364,1705368-1705369,1705542,1706649,1707167,1707169-1707170,1707175,1707397,1707408,1707412,1707642,1707645,1707659,1707844,1708477,1708483,1709212,1709377,1709403,1723875,1729921,1730154,1748497,1755873,1758150,1760461,1761439,1763017,1763019,1765170,1766467,1766915,1780015,1784925,1784961,1785175,1791815,1793216,1797494,1800077,1800568,1802428,1803787,1803939,1804182,1805208,1806314,1811737,1813450,1815700,1838292,1839130
+/openoffice/trunk/main:1571617,1571677,1572569,1572577,1573547,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585171,1585261,1586242,1586249,1586583,1587468,1589050,1591501,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602791,1602823,1602850,1603416,1603897,1603941,1604028,1604709,1604786,1605044,1605355,1605689,1606055,1606061,1606706,1607111,1607793,1607836,1608348,1608376,1608730,1608733,1609204,1609208,1609302,1609426,1610347,1610411,1610422,1610671,1611470,1611549,1612070-1612071,1612539,1612801,1616457,1616944,1620195,1621121,1623847,1623849-1623850,1630814,1633294,1633297,1635806,1642300-1642302,1643177,1650314,1652476,1654282,1668939,1669457,1669459,1669462-1669463,1669465,1677190,1687177,1689883,1689959,1692551,1694132,1694701,1695962,169780
 7,1700078,1700126,1700135,1702107,1702894,1702898,1702986,1702988,1705193,1705196,1705199,1705276,1705364,1705368-1705369,1705542,1706649,1707167,1707169-1707170,1707175,1707397,1707408,1707412,1707642,1707645,1707659,1707844,1708477,1708483,1709212,1709377,1709403,1723875,1729921,1730154,1748497,1755873,1758150,1760461,1761439,1763017,1763019,1765170,1766467,1766915,1780015,1784925,1784961,1785175,1791815,1793216,1797494,1800077,1800568,1802428,1803787,1803939,1804182,1805208,1806314,1811737,1813450,1815700,1838291-1838292,1839130

Propchange: openoffice/branches/AOO416/main/filter/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Oct  7 12:30:02 2018
@@ -2,4 +2,4 @@
 /openoffice/branches/ia2/main/filter:1417739-1541842
 /openoffice/branches/ooxml-osba/main/filter:1546391,1546395,1546574,1546934,1547030,1547392,1551920,1551954,1551958,1552283
 /openoffice/branches/rejuvenate01/main/filter:1480411,1534063,1534098,1536312,1549902,1560617
-/openoffice/trunk/main/filter:1571617,1571677,1572569,1572577,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585261,1585498,1586242,1586249,1586325,1586583,1587468,1589050,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602823,1602850,1603416,1603897,1607839,1621121,1623847,1623849-1623850,1642300-1642302,1692551,1702894,1702898,1702986,1702988,1838292
+/openoffice/trunk/main/filter:1571617,1571677,1572569,1572577,1574058,1574101,1575922,1576216,1576748,1578786,1579934,1580657,1580779,1581746,1581840,1582359,1582365,1582709,1583336,1583418,1583589,1583988,1585261,1585498,1586242,1586249,1586325,1586583,1587468,1589050,1592692,1592716,1594206,1595847,1595851,1595858,1596218,1596491,1596494,1597076,1597102,1597109,1599169,1599173-1599174,1600581,1600587,1600590,1600630,1600861,1600863,1600883,1602434,1602823,1602850,1603416,1603897,1607839,1621121,1623847,1623849-1623850,1642300-1642302,1692551,1702894,1702898,1702986,1702988,1838291-1838292

Modified: openoffice/branches/AOO416/main/filter/inc/filter/msfilter/msdffimp.hxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO416/main/filter/inc/filter/msfilter/msdffimp.hxx?rev=1843062&r1=1843061&r2=1843062&view=diff
==============================================================================
--- openoffice/branches/AOO416/main/filter/inc/filter/msfilter/msdffimp.hxx (original)
+++ openoffice/branches/AOO416/main/filter/inc/filter/msfilter/msdffimp.hxx Sun Oct  7 12:30:02
2018
@@ -658,7 +658,7 @@ public:
         Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup
= 0, sal_Int32* pShapeId = NULL );
 
 	SdrObject* ImportShape( const DffRecordHeader& rHd, SvStream& rSt, void* pData,
-        Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup
= 0, sal_Int32* pShapeId = NULL);
+        Rectangle& rClientRect, const Rectangle& rGlobalChildRect, int nCalledByGroup
= 0, sal_Int32* pShapeId = NULL, sal_Bool bShapeGroup = sal_False);
 
 	Rectangle GetGlobalChildAnchor( const DffRecordHeader& rHd, SvStream& rSt, Rectangle&
aClientRect );
 	void GetGroupAnchors( const DffRecordHeader& rHd, SvStream& rSt,

Modified: openoffice/branches/AOO416/main/filter/source/msfilter/msdffimp.cxx
URL: http://svn.apache.org/viewvc/openoffice/branches/AOO416/main/filter/source/msfilter/msdffimp.cxx?rev=1843062&r1=1843061&r2=1843062&view=diff
==============================================================================
--- openoffice/branches/AOO416/main/filter/source/msfilter/msdffimp.cxx (original)
+++ openoffice/branches/AOO416/main/filter/source/msfilter/msdffimp.cxx Sun Oct  7 12:30:02
2018
@@ -4161,7 +4161,7 @@ SdrObject* SvxMSDffManager::ImportObj( S
     }
     else if ( aObjHd.nRecType == DFF_msofbtSpContainer )
 	{
-		pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup,
pShapeId );
+		pRet = ImportShape( aObjHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup,
pShapeId, sal_False );
     }
     aObjHd.SeekToBegOfRecord( rSt );	// FilePos restaurieren
     return pRet;
@@ -4184,8 +4184,7 @@ SdrObject* SvxMSDffManager::ImportGroup(
 		sal_Int32 nGroupRotateAngle = 0;
 		sal_Int32 nSpFlags = 0;
 		mnFix16Angle = 0;
-		aRecHd.SeekToBegOfRecord( rSt );
-		pRet = ImportObj( rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup + 1,
pShapeId );
+		pRet = ImportShape( aRecHd, rSt, pClientData, rClientRect, rGlobalChildRect, nCalledByGroup
+ 1, pShapeId, sal_True );
 		if ( pRet )
 		{
 			nSpFlags = nGroupShapeFlags;
@@ -4226,7 +4225,7 @@ SdrObject* SvxMSDffManager::ImportGroup(
 					SdrObject* pTmp = ImportGroup( aRecHd2, rSt, pClientData, aGroupClientAnchor, aGroupChildAnchor,
nCalledByGroup + 1, &nShapeId );
 					if ( pTmp )
 					{
-						((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
+						(dynamic_cast<SdrObjGroup*>(pRet))->GetSubList()->NbcInsertObject( pTmp
);
 						if( nShapeId )
 							insertShapeId( nShapeId, pTmp );
 					}
@@ -4235,10 +4234,10 @@ SdrObject* SvxMSDffManager::ImportGroup(
 				{
 					aRecHd2.SeekToBegOfRecord( rSt );
 					sal_Int32 nShapeId;
-					SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect,
nCalledByGroup + 1, &nShapeId );
+					SdrObject* pTmp = ImportShape( aRecHd2, rSt, pClientData, aClientRect, aGlobalChildRect,
nCalledByGroup + 1, &nShapeId, sal_False );
 					if ( pTmp )
 					{
-						((SdrObjGroup*)pRet)->GetSubList()->NbcInsertObject( pTmp );
+						(dynamic_cast<SdrObjGroup*>(pRet))->GetSubList()->NbcInsertObject( pTmp
);
 						if( nShapeId )
 							insertShapeId( nShapeId, pTmp );
 					}
@@ -4271,7 +4270,7 @@ SdrObject* SvxMSDffManager::ImportGroup(
 
 SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& rSt,
void* pClientData,
                                             Rectangle& rClientRect, const Rectangle&
rGlobalChildRect,
-											int nCalledByGroup, sal_Int32* pShapeId )
+											int nCalledByGroup, sal_Int32* pShapeId, sal_Bool bShapeGroup )
 {
 	SdrObject* pRet = NULL;
 
@@ -4311,11 +4310,15 @@ SdrObject* SvxMSDffManager::ImportShape(
 		rSt >> aObjData.nShapeId
 			>> aObjData.nSpFlags;
 		aObjData.eShapeType = (MSO_SPT)maShapeRecords.Current()->nRecInstance;
+		if (bShapeGroup)
+			aObjData.nSpFlags |= SP_FGROUP;
+		else
+			aObjData.nSpFlags &= ~SP_FGROUP;
 	}
 	else
 	{
 		aObjData.nShapeId = 0;
-		aObjData.nSpFlags = 0;
+		aObjData.nSpFlags = bShapeGroup ? SP_FGROUP : 0;
 		aObjData.eShapeType = mso_sptNil;
 	}
 
@@ -4922,8 +4925,8 @@ SdrObject* SvxMSDffManager::ImportShape(
             pRet->SetName( aObjName );
     }
 
-	pRet =
-		ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
+	if (!bShapeGroup)
+		pRet = ProcessObj( rSt, aObjData, pClientData, aTextRect, pRet);
 
 	if ( pRet )
 	{



Mime
View raw message