Author: leidb
Date: Fri Jul 20 02:11:03 2012
New Revision: 1363625
URL: http://svn.apache.org/viewvc?rev=1363625&view=rev
Log:
#120233# fix ppt import bullet size error
Reported by: liu ping tan
Patch by: Sun Ying
Review by: Lei De Bin
Modified:
incubator/ooo/trunk/main/filter/inc/filter/msfilter/svdfppt.hxx
incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx
Modified: incubator/ooo/trunk/main/filter/inc/filter/msfilter/svdfppt.hxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/inc/filter/msfilter/svdfppt.hxx?rev=1363625&r1=1363624&r2=1363625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/inc/filter/msfilter/svdfppt.hxx (original)
+++ incubator/ooo/trunk/main/filter/inc/filter/msfilter/svdfppt.hxx Fri Jul 20
02:11:03 2012
@@ -765,6 +765,7 @@ struct PPTParaSheet
void Read( SdrPowerPointImport& rMan, SvStream& rIn,
sal_Bool bMasterStyle,
sal_uInt32 nLevel, sal_Bool bFirst );
+ void UpdateBulletRelSize( sal_uInt32 nLevel, sal_uInt16
nFontHeight );
};
////////////////////////////////////////////////////////////////////////////////////////////////////
Modified: incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx
URL:
http://svn.apache.org/viewvc/incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx?rev=1363625&r1=1363624&r2=1363625&view=diff
==============================================================================
--- incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx (original)
+++ incubator/ooo/trunk/main/filter/source/msfilter/svdfppt.cxx Fri Jul 20
02:11:03 2012
@@ -4274,6 +4274,18 @@ void PPTParaSheet::Read( SdrPowerPointIm
}
}
+void PPTParaSheet::UpdateBulletRelSize( sal_uInt32 nLevel, sal_uInt16
nFontHeight )
+{
+ if ( maParaLevel[ nLevel ].mnBulletHeight > 0x7fff ) // a negative
value is the absolute bullet height
+ {
+ sal_Int16 nBulletRelSize = ( sal_Int16 )maParaLevel[ nLevel
].mnBulletHeight;
+ nBulletRelSize = nFontHeight ? ((-nBulletRelSize) * 100 ) /
nFontHeight : 100;
+ if ( nBulletRelSize < 0 ) //bullet size over flow
+ nBulletRelSize = 100;
+ maParaLevel[ nLevel ].mnBulletHeight = nBulletRelSize;
+ }
+}
+
PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn,
SdrPowerPointImport& rManager,
const PPTTextCharacterStyleAtomInterpreter&
/*rTxCFStyle*/, const PPTTextParagraphStyleAtomInterpreter& rTxPFStyle,
const
PPTTextSpecInfo& rTextSpecInfo ) :
@@ -4344,6 +4356,7 @@ PPTStyleSheet::PPTStyleSheet( const DffR
}
}
mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE
]->Read( rIn, sal_True, nLev, bFirst );
+ mpParaSheet[ TSS_TYPE_TEXT_IN_SHAPE
]->UpdateBulletRelSize( nLev, mpCharSheet[ TSS_TYPE_TEXT_IN_SHAPE
]->maCharLevel[ nLev ].mnFontHeight );
bFirst = sal_False;
nLev++;
}
@@ -4432,6 +4445,7 @@ PPTStyleSheet::PPTStyleSheet( const DffR
}
mpParaSheet[ nInstance ]->Read( rManager, rIn,
sal_True, nLev, bFirst );
mpCharSheet[ nInstance ]->Read( rIn, sal_True,
nLev, bFirst );
+ mpParaSheet[ nInstance ]->UpdateBulletRelSize(
nLev, mpCharSheet[ nInstance ]->maCharLevel[ nLev ].mnFontHeight );
bFirst = sal_False;
nLev++;
}
@@ -4529,6 +4543,7 @@ PPTStyleSheet::PPTStyleSheet( const DffR
}
}
mpCharSheet[
TSS_TYPE_TEXT_IN_SHAPE ]->Read( rIn, sal_True, nLev, bFirst );
+ mpParaSheet[
TSS_TYPE_TEXT_IN_SHAPE ]->UpdateBulletRelSize( nLev, mpCharSheet[
TSS_TYPE_TEXT_IN_SHAPE ]->maCharLevel[ nLev ].mnFontHeight );
bFirst = sal_False;
nLev++;
}