Commits

Anonymous committed b78fb0d

impress206: #i115898# use updated anchor for group shapes to work around ms office 2010 bug

Comments (0)

Files changed (2)

sd/source/filter/eppt/epptso.cxx

                 ImplFlipBoundingBox( aPropOpt );
             aPropOpt.CreateShapeProperties( mXShape );
 			aPropOpt.Commit( *mpStrm );
-            mpPptEscherEx->AddClientAnchor( maRect );
+			if ( GetCurrentGroupLevel() > 0 )		
+		        mpPptEscherEx->AddChildAnchor( maRect );
+			else
+				mpPptEscherEx->AddClientAnchor( maRect );
 
 			if ( pClientData )
             {
 
             aPropOpt.CreateShapeProperties( mXShape );
             aPropOpt.Commit( *mpStrm );
-            mpPptEscherEx->AddClientAnchor( maRect );
+			if ( GetCurrentGroupLevel() > 0 )		
+		        mpPptEscherEx->AddChildAnchor( maRect );
+			else
+				mpPptEscherEx->AddClientAnchor( maRect );
 
             *mpStrm << (sal_uInt32)( ( ESCHER_ClientTextbox << 16 ) | 0xf )
                     << (sal_uInt32)pClientTextBox->Tell();
 				aPropOpt.CreateShapeProperties( rXShape );
 				aPropOpt.Commit( *mpStrm );
 				aPropOpt2.Commit( *mpStrm, 3, ESCHER_UDefProp );
-				mpPptEscherEx->AddAtom( 8, ESCHER_ClientAnchor );
-				*mpStrm << (sal_Int16)maRect.Top()
-						<< (sal_Int16)maRect.Left()
-						<< (sal_Int16)( maRect.GetWidth()  + maRect.Left() )
-						<< (sal_Int16)( maRect.GetHeight() + maRect.Top() );
+				if ( GetCurrentGroupLevel() > 0 )		
+					mpPptEscherEx->AddChildAnchor( maRect );
+				else
+					mpPptEscherEx->AddClientAnchor( maRect );
 				mpPptEscherEx->CloseContainer();
 
 

sd/source/filter/eppt/escherex.cxx

 		else
 		{
 			AddShape( ESCHER_ShpInst_Min, 0x201, nShapeId );				// Flags: Group | HaveAnchor
-			AddAtom( 8, ESCHER_ClientAnchor );
-			PtReplaceOrInsert( ESCHER_Persist_Grouping_Logic | mnGroupLevel, mpOutStrm->Tell() );
-			*mpOutStrm << (INT16)aRect.Top() << (INT16)aRect.Left() << (INT16)aRect.Right() << (INT16)aRect.Bottom();
+			if ( mnGroupLevel == 1 )
+			{
+				AddAtom( 8, ESCHER_ClientAnchor );
+				PtReplaceOrInsert( ESCHER_Persist_Grouping_Logic | mnGroupLevel, mpOutStrm->Tell() );
+				*mpOutStrm << (INT16)aRect.Top() << (INT16)aRect.Left() << (INT16)aRect.Right() << (INT16)aRect.Bottom();
+			}
+			else
+			{
+				AddAtom( 16, ESCHER_ChildAnchor );
+				PtReplaceOrInsert( ESCHER_Persist_Grouping_Snap | mnGroupLevel, mpOutStrm->Tell() );
+				*mpOutStrm  << (sal_Int32)aRect.Left()
+							<< (sal_Int32)aRect.Top()
+							<< (sal_Int32)aRect.Right()
+							<< (sal_Int32)aRect.Bottom();
+			}
 		}
 		if ( pClientData )
 		{