Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


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 <jeffdchang@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 header&footer 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_Bool    bRightToLeft = ( 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, aLayoutSize);
         break;
+        }
     case 6: // title, 4 shapes
     {
         sal_uLong nX = long (aLayoutPos.X());
@@ -1311,6 +1317,7 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* 
rRe
     case 7: // vertical title, shape above shape
     {
         Size aSize( rRectangle[0].GetSize().Height(), rRectangle[1].BottomLeft().Y() - 
rRectangle[0].TopLeft().Y() );
+        //aSize.Height() = long (aSize.Height() * 0.85);
         rRectangle[0].SetSize( aSize );
         rRectangle[0].SetPos( aTitleRect.TopRight() - Point( aSize.Width(), 0 ) );
 
@@ -1332,6 +1339,7 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* 
rRe
     case 8: // vertical title, shape
     {
         Size aSize( rRectangle[0].GetSize().Height(), rRectangle[1].BottomLeft().Y() - 
rRectangle[0].TopLeft().Y() );
+        //aSize.Height() = long (aSize.Height() * 0.85);
         rRectangle[0].SetSize( aSize );
         rRectangle[0].SetPos( aTitleRect.TopRight() - Point( aSize.Width(), 0 ) );
 
@@ -1343,9 +1351,21 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* 
rRe
         rRectangle[1].SetSize( aSize );
         break;
     }
+    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;
+        }
     case 10: // onlytext
     {
         Size aSize( rRectangle[0].GetSize().Width(), rRectangle[1].BottomLeft().Y() - 
rRectangle[0].TopLeft().Y() );
+        //aSize.Height() = long (aSize.Height() * 0.85);
         rRectangle[0].SetSize( aSize );
         rRectangle[0].SetPos( aTitlePos);
         break;
@@ -1462,7 +1482,7 @@ void findAutoLayoutShapesImpl( SdPage& rPage, const LayoutDescriptor& 
rDescripto
                 case PRESOBJ_GRAPHIC:
                     bFound = eSdrObjKind == OBJ_GRAF;
                     break;
-                case PRESOBJ_OBJECT:
+                case PRESOBJ_OBJECT://WHAT The...
                     if( eSdrObjKind == OBJ_OLE2 )
                     {
                         SdrOle2Obj* pOle2 = dynamic_cast< SdrOle2Obj* >( pObj );
@@ -2406,21 +2426,6 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, 
PresObjKind eO
 
                     aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t\t" 
));
                     aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER4 ) );
-
-                    aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "\n\t\t\t\t\t" 
));
-                    aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER5 ) );
-
-                    aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( 
"\n\t\t\t\t\t\t" ));
-                    aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER6 ) );
-
-                    aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( 
"\n\t\t\t\t\t\t\t" ));
-                    aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER7 ) );
-
-                    aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( 
"\n\t\t\t\t\t\t\t\t" ));
-                    aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER8 ) );
-
-                    aString += String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( 
"\n\t\t\t\t\t\t\t\t\t" ));
-                    aString += String ( SdResId( STR_PRESOBJ_MPOUTLLAYER9 ) );
                 }
             }
             break;
-- 
1.7.3.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.