Re: [Libreoffice] [PATCH] for Bug 32719
Hi Thorsten and Jeffrey, I think the patch is for: https://bugs.freedesktop.org/show_bug.cgi?id=32719 while Rainer's comment#3 is in the bug which was more related with bug (Jeffrey discovered it when trying to fix 32719): https://bugs.freedesktop.org/show_bug.cgi?id=39705 So the two bugs seem to be 2 different problems, am I understanding it correctly? Hope I didn't give more confusing here, and please just ignore me if I missed some background, thanks! :) Best wishes, Yifan >>> jeffrey chang 08/17/11 11:33 AM >>> Hi Thorsten, Jan, and Co. Sorry for the delay. Here is the revised patch that fixes the dimension problem without all the rough scratch work/comments from last time. I will look into Rainer's comment. Jeffrey On Thu, Aug 11, 2011 at 1:50 AM, Thorsten Behrens wrote: jeffrey chang wrote: > 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 > Hi Jeffrey, thanks a lot for that patch - we've talked about this bug, glad to see you tackling this. I've applied it & played a bit with it - the behaviour is changed, but at least for the scenario Rainer describes in comment #3 in the bug, not fixed? Maybe I'm missing something, are there other changes I need? Cheers, -- Thorsten -- --Jeffrey Chang ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] for Bug 32719
Hi Thorsten, Jan, and Co. Sorry for the delay. Here is the revised patch that fixes the dimension problem without all the rough scratch work/comments from last time. I will look into Rainer's comment. Jeffrey On Thu, Aug 11, 2011 at 1:50 AM, Thorsten Behrens < t...@documentfoundation.org> wrote: > jeffrey chang wrote: > > 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 > > > Hi Jeffrey, > > thanks a lot for that patch - we've talked about this bug, glad to > see you tackling this. > > I've applied it & played a bit with it - the behaviour is changed, > but at least for the scenario Rainer describes in comment #3 in the > bug, not fixed? Maybe I'm missing something, are there other changes > I need? > > Cheers, > > -- Thorsten > -- --Jeffrey Chang From 349f813ac3de560a42a3de0138cfed7eaf4162af Mon Sep 17 00:00:00 2001 From: Jeffrey Chang Date: Wed, 17 Aug 2011 23:30:02 +0800 Subject: [PATCH] Fixed template dimension problem on Impress. --- sd/source/core/sdpage.cxx |9 ++--- 1 files changed, 2 insertions(+), 7 deletions(-) diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index 8af853f..8fc20d8 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -1070,8 +1070,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); } @@ -2416,11 +2416,6 @@ void SdPage::SetObjText(SdrTextObj* pObj, SdrOutliner* pOutliner, PresObjKind eO 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 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] for Bug 32719
Hi Jeffrey, jeffrey chang píše v Po 01. 08. 2011 v 13:27 +0800: > Here is the patch for EasyHack 32719. Thank you very much for the patch! Before we can apply it, can you please clean it up a bit? - please do not introduce commented out code [like: // aLayoutSize.Height() = long (aLayoutSize.Height() * 0.85);] In case you need it for the debugging purposes, either use eg. OSL_TRACE, or any other debugging macro, or enclose it in #if OSL_DEBUG_LEVEL > 1 block - it is not necessary to add { } blocks in switch - +case 1: // title, 2 shapes +{ +} case 2: // title, shape, 2 shapes Is really the 'case 1' supposed to fall-through to case 2? If yes, please do not add the {} block, and - even better - add a comment that the fall-through is intended. - comment '// WHAT The...' does not help to understand the patch, I am afraid ;-) What is happening there, please? Thank you a lot, Kendy ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice] [PATCH] for Bug 32719 (jeffrey chang)
Hi, Thank you for the patch. Assuming this is your first patch (or at-least one of the first few), I have a few suggestions: 1. It would nice if you could remove the test code commented - helps in reviewing quickly. 2. You have changed the multipliers in multiple locations - are you sure these don't affect the normal working? (say, having a blank template?) 3. It would also be nice if you could explain the reason for removing the content from STR_PRESOBJ_MPOUTLLAYER5 to STR_PRESOBJ_MPOUTLLAYER9 Will wait for your updates before pushing... Thanks again for your nice work... Regards, Muthu Subramanian -- Date: Mon, 1 Aug 2011 13:27:33 +0800 From: jeffrey chang Subject: [Libreoffice] [PATCH] for Bug 32719 To: libreoffice@lists.freedesktop.org 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 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice] [PATCH] for Bug 32719
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 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_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, aLayoutSize);