[Libreoffice-commits] core.git: sd/source
Andre Fischer
af at apache.org
Wed May 15 07:47:18 PDT 2013
sd/source/filter/eppt/epptso.cxx | 57 ++++++++++++++++++++++++++++-----------
1 file changed, 42 insertions(+), 15 deletions(-)
New commits:
commit 578bd45644657a9f7ae99f525eeb5c653103dcf8
Author: Andre Fischer <af at apache.org>
Date: Mon Jul 9 08:04:21 2012 +0000
Resolves: #i119551# Avoid grouping shapes on import from PPT...
under certain conditions.
Reported by: Li Feng Wang
Patch and review by: Ma Bingbing and Armin Le Grand
(cherry picked from commit f425d556504e055216d9402241ff598a97204509)
Conflicts:
sd/source/filter/eppt/epptso.cxx
(cherry picked from commit 8c23e31acc61406103c1565960e4c5b391902754)
Change-Id: I7e610b754ff7215201bc1ac47d618869e4e8fe2b
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 356ddfb..f5ebfa5 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -2242,7 +2242,10 @@ void PPTWriter::ImplCreateTextShape( EscherPropertyContainer& rPropOpt, EscherSo
void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& aSolverContainer, PageType ePageType, sal_Bool bMasterPage, int nPageNumber )
{
- sal_uInt32 nInstance, nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nGroupLevel = 0, nOlePictureId;
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // sal_uInt32 nGroupLevel = 0;
+
+ sal_uInt32 nInstance, nGroups, nShapes, nShapeCount, nPer, nLastPer, nIndices, nOlePictureId;
sal_uInt16 nEffectCount;
::com::sun::star::awt::Point aTextRefPoint;
@@ -2497,8 +2500,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aPolygon.Rotate( aRect.TopLeft(), (sal_uInt16)( mnAngle / 10 ) );
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bNeedText = sal_False;
bAdditionalText = sal_True;
mnTextSize = 0;
@@ -2693,7 +2697,8 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
aTextRefPoint = ::com::sun::star::awt::Point( maRect.Left(), maRect.Top() );
mnTextSize = 0;
bAdditionalText = sal_True;
- mpPptEscherEx->EnterGroup( &maRect,0 );
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( &maRect,0 );
}
mpPptEscherEx->OpenContainer( ESCHER_SpContainer );
sal_uInt32 nFlags = 0xa00; // Flags: Connector | HasSpt
@@ -2711,8 +2716,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -2730,8 +2736,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -2749,8 +2756,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -2768,8 +2776,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
{
if ( ImplGetText() )
{
- mpPptEscherEx->EnterGroup( 0,0 );
- nGroupLevel = mpPptEscherEx->GetGroupLevel();
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->EnterGroup( 0,0 );
+ // nGroupLevel = mpPptEscherEx->GetGroupLevel();
bAdditionalText = sal_True;
mnTextSize = 0;
}
@@ -2826,8 +2835,22 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
else
{
ImplCreateShape( ESCHER_ShpInst_PictureFrame, 0xa00, aSolverContainer );
+ const Rectangle aOldRect100thmm(aRect100thmm);
+
if ( aPropOpt.CreateGraphicProperties( mXPropSet, OUString( "GraphicURL" ), sal_False, sal_True ) )
+ {
aPropOpt.AddOpt( ESCHER_Prop_LockAgainstGrouping, 0x800080 );
+
+ if(aOldRect100thmm != aRect100thmm)
+ {
+ // #119536# graphic has been adapted (rotated) so that it can be saved without angle,
+ // adapt local values as needed
+ maPosition = MapPoint( ::com::sun::star::awt::Point( aRect100thmm.Left(), aRect100thmm.Top() ) );
+ maSize = MapSize( ::com::sun::star::awt::Size ( aRect100thmm.GetWidth(), aRect100thmm.GetHeight() ) );
+ maRect = Rectangle( Point( maPosition.X, maPosition.Y ), Size( maSize.Width, maSize.Height ) );
+ mnAngle = 0;
+ }
+ }
}
}
}
@@ -3493,8 +3516,10 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
mnAngle += 0x8000;
mnAngle &=~0xffff; // round nAngle to full grad
aPropOpt.AddOpt( ESCHER_Prop_Rotation, mnAngle );
- mpPptEscherEx->SetGroupSnapRect( nGroupLevel, maRect );
- mpPptEscherEx->SetGroupLogicRect( nGroupLevel, maRect );
+
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->SetGroupSnapRect( nGroupLevel, maRect );
+ // mpPptEscherEx->SetGroupLogicRect( nGroupLevel, maRect );
}
if ( !pClientTextBox )
pClientTextBox = new SvMemoryStream( 0x200, 0x200 );
@@ -3516,7 +3541,9 @@ void PPTWriter::ImplWritePage( const PHLayout& rLayout, EscherSolverContainer& a
delete pClientTextBox, pClientTextBox = NULL;
mpPptEscherEx->CloseContainer(); // ESCHER_SpContainer
- mpPptEscherEx->LeaveGroup();
+
+ // #i119551# PPT does not support groups of polygons and text (MS patch KB2289187)
+ // mpPptEscherEx->LeaveGroup();
}
}
ClearGroupTable(); // storing groups if any are still open, which should not be the case
More information about the Libreoffice-commits
mailing list