summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSun Ying <sunying@apache.org>2012-08-16 04:20:44 +0000
committerXisco Fauli <anistenis@gmail.com>2013-04-07 23:37:39 +0200
commit844e62d5ab9ddc77a1ea859653549ea71bcb6656 (patch)
treed75b69c3c9e146027b52bb4357ef110b3ff52122
parentb619ffdbb3656bc01a603afb26caea8a483bc5ec (diff)
Fix #119523# fix the indent and left margin attribute lost when save as .ppt
Reported by: liupingtan Patch by: Ying Sun Review by: Jian Yuan Li(cherry picked from commit 6fa2e38b9cd3ce0df5876d849bcba7d879a6e329) Conflicts: sd/source/filter/eppt/epptso.cxx Change-Id: I41150838d153c3b99e603924127787f5556ef383
-rw-r--r--filter/source/msfilter/svdfppt.cxx15
-rw-r--r--sd/source/filter/eppt/epptso.cxx11
2 files changed, 22 insertions, 4 deletions
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index cb8cce6d7b30..0921f64a01bd 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -4876,9 +4876,15 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport&
if ( nMask & 0x4000 ) // pfSpaceAfter
rIn >> aSet.mpArry[ PPT_ParaAttr_LowerDist ];
if ( nMask & 0x100 ) // pfLeftMargin
- rIn >> nDummy16;
+ {
+ rIn >> aSet.mpArry[ PPT_ParaAttr_TextOfs ];
+ aSet.mnAttrSet |= 1 << PPT_ParaAttr_TextOfs;
+ }
if ( nMask & 0x400 ) // pfIndent
- rIn >> nDummy16;
+ {
+ rIn >> aSet.mpArry[ PPT_ParaAttr_BulletOfs ];
+ aSet.mnAttrSet |= 1 << PPT_ParaAttr_BulletOfs;
+ }
if ( nMask & 0x8000 ) // pfDefaultTabSize
rIn >> nDummy16;
if ( nMask & 0x100000 ) // pfTabStops
@@ -4910,9 +4916,10 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport&
else
nCharCount = nStringLen;
- if ( rRuler.GetTextOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_TextOfs ] ) )
+ //if the textofs attr has been read at above, need not to reset.
+ if ( ( !( aSet.mnAttrSet & 1 << PPT_ParaAttr_TextOfs ) ) && rRuler.GetTextOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_TextOfs ] ) )
aSet.mnAttrSet |= 1 << PPT_ParaAttr_TextOfs;
- if ( rRuler.GetBulletOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_BulletOfs ] ) )
+ if ( ( !( aSet.mnAttrSet & 1 << PPT_ParaAttr_BulletOfs ) ) && rRuler.GetBulletOfs( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_BulletOfs ] ) )
aSet.mnAttrSet |= 1 << PPT_ParaAttr_BulletOfs;
if ( rRuler.GetDefaultTab( aParaPropSet.pParaSet->mnDepth, aSet.mpArry[ PPT_ParaAttr_DefaultTab ] ) )
aSet.mnAttrSet |= 1 << PPT_ParaAttr_DefaultTab;
diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx
index 05332830c128..16f9ae0158d7 100644
--- a/sd/source/filter/eppt/epptso.cxx
+++ b/sd/source/filter/eppt/epptso.cxx
@@ -798,6 +798,13 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
nPropertyFlags |= 1; // turn off bullet explicit
nBulletFlags = 0;
}
+
+ // Write nTextOfs and nBullets
+ if ( mpStyleSheet->IsHardAttribute( nInstance, nDepth, ParaAttr_TextOfs, pPara->nTextOfs ) )
+ nPropertyFlags |= 0x100;
+ if ( mpStyleSheet->IsHardAttribute( nInstance, nDepth, ParaAttr_BulletOfs, pPara->nBulletOfs ))
+ nPropertyFlags |= 0x400;
+
FontCollectionEntry aFontDescEntry( pPara->aFontDesc.Name, pPara->aFontDesc.Family, pPara->aFontDesc.Pitch, pPara->aFontDesc.CharSet );
sal_uInt16 nFontId = (sal_uInt16)maFontCollection.GetId( aFontDescEntry );
@@ -836,6 +843,10 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
rOut << (sal_uInt16)( pPara->mnLineSpacingTop );
if ( nPropertyFlags & 0x00004000 )
rOut << (sal_uInt16)( pPara->mnLineSpacingBottom );
+ if ( nPropertyFlags & 0x100 )
+ rOut << (sal_uInt16)(pPara->nTextOfs);
+ if ( nPropertyFlags & 0x400 )
+ rOut << (sal_uInt16)(pPara->nBulletOfs);
if ( nPropertyFlags & 0x000e0000 )
{
sal_uInt16 nAsianSettings = 0;