merge the formfield patch from ooo-build
[ooovba.git] / applied_patches / 0510-fix-ppt-linespacing-import-export.diff
blob5218de2cfda09ae5a6ea5be7b8248f9e7bf7c7ef
1 diff -rup ../ooh680-m1/sd/source/filter/eppt/eppt.hxx sd/source/filter/eppt/eppt.hxx
2 --- ../ooh680-m1/sd/source/filter/eppt/eppt.hxx 2006-12-12 17:39:02.000000000 +0100
3 +++ sd/source/filter/eppt/eppt.hxx 2008-02-04 17:13:48.000000000 +0100
4 @@ -739,6 +739,7 @@ class ParagraphObj : public List, public
6 sal_uInt16 mnTextAdjust;
7 sal_Int16 mnLineSpacing;
8 + sal_Bool mbFixedLineSpacing;
9 sal_Int16 mnLineSpacingTop;
10 sal_Int16 mnLineSpacingBottom;
11 sal_Bool mbForbiddenRules;
12 diff -rup ../ooh680-m1/sd/source/filter/eppt/epptso.cxx sd/source/filter/eppt/epptso.cxx
13 --- ../ooh680-m1/sd/source/filter/eppt/epptso.cxx 2007-08-02 20:22:59.000000000 +0200
14 +++ sd/source/filter/eppt/epptso.cxx 2008-02-04 17:16:29.000000000 +0100
15 @@ -1428,7 +1428,7 @@ void PPTWriter::ImplWriteParagraphs( SvS
17 else
19 - if ( pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
20 + if ( !pPara->mbFixedLineSpacing && pPortion && pPortion->mnCharHeight > (sal_uInt16)( ((double)-nLineSpacing) * 0.001 * 72.0 / 2.54 ) ) // 1/100mm to point
21 nLineSpacing = nNormalSpacing;
22 else
23 nLineSpacing = (sal_Int16)( (double)nLineSpacing / 4.40972 );
24 @@ -2858,11 +2858,15 @@ void ParagraphObj::ImplGetParagraphValue
25 = *( (::com::sun::star::style::LineSpacing*)mAny.getValue() );
26 switch ( aLineSpacing.Mode )
28 + case ::com::sun::star::style::LineSpacingMode::FIX :
29 + mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
30 + mbFixedLineSpacing = TRUE;
31 + break;
32 case ::com::sun::star::style::LineSpacingMode::MINIMUM :
33 case ::com::sun::star::style::LineSpacingMode::LEADING :
34 - case ::com::sun::star::style::LineSpacingMode::FIX :
35 mnLineSpacing = (sal_Int16)(-( aLineSpacing.Height ) );
36 - break;
37 + mbFixedLineSpacing = FALSE;
38 + break;
40 case ::com::sun::star::style::LineSpacingMode::PROP :
41 default:
42 diff -rup ../ooh680-m1/sd/source/ui/dlg/paragr.cxx sd/source/ui/dlg/paragr.cxx
43 --- ../ooh680-m1/sd/source/ui/dlg/paragr.cxx 2006-12-12 18:07:46.000000000 +0100
44 +++ sd/source/ui/dlg/paragr.cxx 2008-01-28 16:30:13.000000000 +0100
45 @@ -77,3 +80,17 @@ SdParagraphDlg::SdParagraphDlg( Window*
47 AddTabPage( RID_SVXPAGE_TABULATOR );
50 +void SdParagraphDlg::PageCreated( USHORT nId, SfxTabPage &rPage )
52 + SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
53 + switch( nId )
54 + {
55 + case RID_SVXPAGE_STD_PARAGRAPH:
56 + aSet.Put(SfxUInt32Item(SID_SVXSTDPARAGRAPHTABPAGE_ABSLINEDIST, MM50/2));
57 + rPage.PageCreated(aSet);
58 + break;
59 + default:
60 + break;
61 + }
63 diff -rup ../ooh680-m1/sd/source/ui/inc/paragr.hxx sd/source/ui/inc/paragr.hxx
64 --- ../ooh680-m1/sd/source/ui/inc/paragr.hxx 2005-09-09 07:48:22.000000000 +0200
65 +++ sd/source/ui/inc/paragr.hxx 2008-01-28 16:25:32.000000000 +0100
66 @@ -53,6 +53,8 @@ class SdParagraphDlg : public SfxTabDial
67 private:
68 const SfxItemSet& rOutAttrs;
70 + virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
72 public:
73 SdParagraphDlg( Window* pParent, const SfxItemSet* pAttr );
74 ~SdParagraphDlg() {};
75 diff -rup ../ooh680-m1/svx/source/editeng/impedit3.cxx svx/source/editeng/impedit3.cxx
76 --- ../ooh680-m1/svx/source/editeng/impedit3.cxx 2007-08-02 15:59:22.000000000 +0200
77 +++ svx/source/editeng/impedit3.cxx 2008-01-25 17:51:36.000000000 +0100
78 @@ -1312,6 +1312,13 @@ sal_Bool ImpEditEngine::CreateLines( USH
79 pLine->SetHeight( nMinHeight, nTxtHeight );
82 + else if ( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_FIX )
83 + {
84 + sal_uInt16 nFixHeight = GetYValue( rLSItem.GetLineHeight() );
85 + sal_uInt16 nTxtHeight = pLine->GetHeight();
86 + pLine->SetMaxAscent( (sal_uInt16)(pLine->GetMaxAscent() + ( nFixHeight - nTxtHeight ) ) );
87 + pLine->SetHeight( nFixHeight, nTxtHeight );
88 + }
89 else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP )
91 if ( nPara || IsFixedCellHeight() || pLine->GetStartPortion() ) // Nicht die aller erste Zeile
92 @@ -1654,6 +1668,14 @@ void ImpEditEngine::CreateAndInsertEmpty
93 pTmpLine->SetHeight( nMinHeight, nTxtHeight );
96 + else if ( rLSItem.GetLineSpaceRule() == SVX_LINE_SPACE_FIX )
97 + {
98 + sal_uInt16 nFixHeight = rLSItem.GetLineHeight();
99 + sal_uInt16 nTxtHeight = pTmpLine->GetHeight();
101 + pTmpLine->SetMaxAscent( (sal_uInt16)(pTmpLine->GetMaxAscent() + ( nFixHeight - nTxtHeight ) ) );
102 + pTmpLine->SetHeight( nFixHeight, nTxtHeight );
104 else if ( rLSItem.GetInterLineSpaceRule() == SVX_INTER_LINE_SPACE_PROP )
106 USHORT nPara = GetParaPortions().GetPos( pParaPortion );
107 diff -rup ../ooh680-m1/svx/source/svdraw/svdfppt.cxx svx/source/svdraw/svdfppt.cxx
108 --- ../ooh680-m1/svx/source/svdraw/svdfppt.cxx 2008-01-08 10:24:29.000000000 +0100
109 +++ svx/source/svdraw/svdfppt.cxx 2008-02-04 12:10:08.000000000 +0100
110 @@ -6326,9 +6326,11 @@ void PPTParagraphObj::ApplyTo( SfxItemSe
112 rSet.Put( SdrTextFixedCellHeightItem( TRUE ), SDRATTR_TEXT_USEFIXEDCELLHEIGHT );
113 SvxLineSpacingItem aItem( 200, EE_PARA_SBL );
114 - if ( nVal2 <= 0 )
115 + if ( nVal2 <= 0 ) {
116 aItem.SetLineHeight( (UINT16)( rManager.ScalePoint( -nVal2 ) / 8 ) );
117 - else
118 + aItem.GetLineSpaceRule() = SVX_LINE_SPACE_FIX;
119 + aItem.GetInterLineSpaceRule() = SVX_INTER_LINE_SPACE_OFF;
120 + } else
122 sal_uInt8 nPropLineSpace = (BYTE)nVal2;
123 aItem.SetPropLineSpace( nPropLineSpace );