Here is the patch for EasyHack 32719. I have also discovered another bug
relating to Impress Templates, documented here:
https://bugs.freedesktop.org/show_bug.cgi?id=39705
I am submitting this under the LGPLv3+/MPL 1.1 license.
Thanks,
--
--Jeffrey Chang
From cc0eaea9cbb38dfab3ac92641b29822a9631bcb6 Mon Sep 17 00:00:00 2001
From: Jeffrey Chang jeffdch...@gmail.com
Date: Tue, 2 Aug 2011 00:24:08 +0800
Subject: [PATCH] Fixed the textbox dimension problem on MasterPages in impress.
---
sd/source/core/sdpage.cxx | 67 -
1 files changed, 36 insertions(+), 31 deletions(-)
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 8af853f..451299c 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -850,6 +850,7 @@ void SdPage::CreateTitleAndLayout(sal_Bool bInit, sal_Bool bCreate )
SdrObject* pNumber = pMasterPage-GetPresObj( PRESOBJ_SLIDENUMBER );
if( pNumber == NULL )
pMasterPage-CreateDefaultPresObj( PRESOBJ_SLIDENUMBER, true );
+
}
}
}
@@ -921,8 +922,8 @@ SdrObject* SdPage::CreateDefaultPresObj(PresObjKind eObjKind, bool bInsert)
// create headerfooter objects for handout and notes master
Point aTitlePos ( GetLftBorder(), GetUppBorder() );
Size aPageSize ( GetSize() );
-aPageSize.Width() -= GetLftBorder() + GetRgtBorder();
-aPageSize.Height() -= GetUppBorder() + GetLwrBorder();
+aPageSize.Width() -= GetLftBorder() + GetRgtBorder()*5;
+aPageSize.Height() -= GetUppBorder() + GetLwrBorder()*5;
const int NOTES_HEADER_FOOTER_WIDTH = long(aPageSize.Width() * 0.434);
@@ -1070,8 +1071,8 @@ Rectangle SdPage::GetLayoutRect() const
{
aLayoutPos.X() += long( aLayoutSize.Width() * 0.05 );
aLayoutPos.Y() += long( aLayoutSize.Height() * 0.234 );
-aLayoutSize.Width() = long( aLayoutSize.Width() * 0.9 );
-aLayoutSize.Height() = long( aLayoutSize.Height() * 0.66 );
+aLayoutSize.Width() = long( aLayoutSize.Width() * 0.88 );
+aLayoutSize.Height() = long( aLayoutSize.Height() * 0.58 );
aLayoutRect.SetPos(aLayoutPos);
aLayoutRect.SetSize(aLayoutSize);
}
@@ -1209,22 +1210,21 @@ static void CalcAutoLayoutRectangles( SdPage rPage, int nLayout, Rectangle* rRe
sal_BoolbRightToLeft = ( rPage.GetModel() static_cast SdDrawDocument* ( rPage.GetModel() )-GetDefaultWritingMode() == ::com::sun::star::text::WritingMode_RL_TB );
+//aLayoutSize.Height() = long (aLayoutSize.Height() * 0.85);
+
switch( nLayout )
{
case 0: // default layout using only the title and layout area
-break; // do nothing
-case 1: // title, 2 shapes
-case 9: // title, 2 vertical shapes
-aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
+{
rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
-
aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
-rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
-
-if( bRightToLeft (nLayout != 9) )
-::std::swap Rectangle ( rRectangle[1], rRectangle[2] );
-break;
+break; // do nothing
+}
+case 1: // title, 2 shapes
+{
+}
case 2: // title, shape, 2 shapes
+{
aTempPnt = aLayoutPos;
aTempSize = aLayoutSize;
aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
@@ -1246,7 +1246,9 @@ static void CalcAutoLayoutRectangles( SdPage rPage, int nLayout, Rectangle* rRe
rRectangle[3].Left() = rRectangle[2].Left();
}
break;
+}
case 3: // title, 2 shapes, shape
+{
aTempPnt = aLayoutPos;
aTempSize = aLayoutSize;
aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
@@ -1268,15 +1270,18 @@ static void CalcAutoLayoutRectangles( SdPage rPage, int nLayout, Rectangle* rRe
rRectangle[3].Left() = rRectangle[2].Left();
}
break;
+}
case 4: // title, shape above shape
+{
aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
break;
-
+}
case 5: // title, 2 shapes above shape
+{
aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
@@ -1290,6 +1295,7 @@ static void CalcAutoLayoutRectangles( SdPage rPage, int nLayout, Rectangle* rRe
aLayoutSize.Width() = long (aLayoutSize.Width() / 0.488);
rRectangle[3] = Rectangle (aLayoutPos,