[Libreoffice-commits] core.git: Branch 'feature/gsoc-impresslayout' - sd/source sd/xml test/user-template
Vishv Brahmbhatt
vishvbrahmbhatt19 at gmail.com
Wed Jul 10 08:11:29 PDT 2013
sd/source/core/sdpage.cxx | 75 ++++++++--
sd/xml/layoutlist.xml | 2
test/user-template/user/config/soffice.cfg/simpress/layoutlist.xml | 2
3 files changed, 66 insertions(+), 13 deletions(-)
New commits:
commit 04f7fafadcda40d35b92aa580984e2bc7da03dbb
Author: Vishv Brahmbhatt <vishvbrahmbhatt19 at gmail.com>
Date: Wed Jul 10 20:25:43 2013 +0530
Adding new Slide Layouts Samples to "layoutlist.xml".
Have added new "Slide Layouts" samples.So commented out the code related to existing slide layouts in "sdpage.cxx" and also added some code
for XML parsing of the new layouts.
Change-Id: I8f5fdcab5f2eb41e37fa522a7801b388cbfefed5
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index 96961a0..051cadc 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -1417,34 +1417,83 @@ static void CalcAutoLayoutRectangles( SdPage& rPage, int nLayout, Rectangle* rRe
break;
case 5: // title, 2 shapes above shape
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
+ // aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
+ // aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
+ // rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+
+ // aTempPnt = aLayoutPos;
+ // aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
+ // rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+
+ // aLayoutPos.X() = aTempPnt.X();
+ // aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
+ // aLayoutSize.Width() = long (aLayoutSize.Width() / 0.488);
+ // rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+ // break;
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_CONTENT_2CONTENT" ,"PRESOBJ_OUTLINE1" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
- aTempPnt = aLayoutPos;
- aLayoutPos.X() = long (aLayoutPos.X() + aLayoutSize.Width() * 1.05);
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_CONTENT_2CONTENT" ,"PRESOBJ_OUTLINE2" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
- aLayoutPos.X() = aTempPnt.X();
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
- aLayoutSize.Width() = long (aLayoutSize.Width() / 0.488);
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_CONTENT_2CONTENT" ,"PRESOBJ_OUTLINE3" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
break;
case 6: // title, 4 shapes
{
- sal_uLong nX = long (aLayoutPos.X());
+ // sal_uLong nX = long (aLayoutPos.X());
- aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
- aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
+ // aLayoutSize.Height() = long (aLayoutSize.Height() * 0.477);
+ // aLayoutSize.Width() = long (aLayoutSize.Width() * 0.488);
+ // rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
+
+ // aLayoutPos.X() = long (nX + aLayoutSize.Width() * 1.05);
+ // rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
+
+ // aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
+ // rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
+
+ // aLayoutPos.X() = nX;
+ // rRectangle[4] = Rectangle (aLayoutPos, aLayoutSize);
+ // break;
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_4SCONTENT" ,"PRESOBJ_OUTLINE1" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[1] = Rectangle (aLayoutPos, aLayoutSize);
- aLayoutPos.X() = long (nX + aLayoutSize.Width() * 1.05);
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_4SCONTENT" ,"PRESOBJ_OUTLINE2" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[2] = Rectangle (aLayoutPos, aLayoutSize);
- aLayoutPos.Y() = long (aLayoutPos.Y() + aLayoutSize.Height() * 1.095);
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_4SCONTENT" ,"PRESOBJ_OUTLINE3" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[3] = Rectangle (aLayoutPos, aLayoutSize);
- aLayoutPos.X() = nX;
+ readLayoutPropFromFile(root, "AUTOLAYOUT_TITLE_4SCONTENT" ,"PRESOBJ_OUTLINE4" ,propvalue);
+ aLayoutPos.X() = propvalue[0];
+ aLayoutPos.Y() = propvalue[1];
+ aLayoutSize.Height() = propvalue[2];
+ aLayoutSize.Width() = propvalue[3];
rRectangle[4] = Rectangle (aLayoutPos, aLayoutSize);
break;
}
diff --git a/sd/xml/layoutlist.xml b/sd/xml/layoutlist.xml
index 61b863d..6695c53 100644
--- a/sd/xml/layoutlist.xml
+++ b/sd/xml/layoutlist.xml
@@ -5,4 +5,6 @@
<layout type="AUTOLAYOUT_TITLE_CONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="25200" layout-size-width="12180"/></layout>
<layout type="AUTOLAYOUT_TITLE_2VTEXT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="12297" layout-size-width="12180"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="14311" layout-pos-y="4914" layout-size-height="12297" layout-size-width="12180"/></layout>
<layout type="AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="25200" layout-size-width="5809"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="1400" layout-pos-y="11274" layout-size-height="25200" layout-size-width="5809"/></layout>
+<layout type="AUTOLAYOUT_TITLE_CONTENT_2CONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="5809" layout-size-width="25198"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="1400" layout-pos-y="11274" layout-size-height="5809" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE3" layout-pos-x="14311" layout-pos-y="11274" layout-size-height="5809" layout-size-width="12297"/></layout>
+<layout type="AUTOLAYOUT_TITLE_4SCONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="5809" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="14311" layout-pos-y="5914" layout-size-height="4509" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE3" layout-pos-x="14311" layout-pos-y="12274" layout-size-height="4509" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE4" layout-pos-x="1400" layout-pos-y="11274" layout-size-height="5809" layout-size-width="12297"/></layout>
</layout-list>
\ No newline at end of file
diff --git a/test/user-template/user/config/soffice.cfg/simpress/layoutlist.xml b/test/user-template/user/config/soffice.cfg/simpress/layoutlist.xml
index 61b863d..6695c53 100644
--- a/test/user-template/user/config/soffice.cfg/simpress/layoutlist.xml
+++ b/test/user-template/user/config/soffice.cfg/simpress/layoutlist.xml
@@ -5,4 +5,6 @@
<layout type="AUTOLAYOUT_TITLE_CONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="25200" layout-size-width="12180"/></layout>
<layout type="AUTOLAYOUT_TITLE_2VTEXT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="12297" layout-size-width="12180"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="14311" layout-pos-y="4914" layout-size-height="12297" layout-size-width="12180"/></layout>
<layout type="AUTOLAYOUT_TITLE_CONTENT_OVER_CONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="25200" layout-size-width="5809"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="1400" layout-pos-y="11274" layout-size-height="25200" layout-size-width="5809"/></layout>
+<layout type="AUTOLAYOUT_TITLE_CONTENT_2CONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="5809" layout-size-width="25198"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="1400" layout-pos-y="11274" layout-size-height="5809" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE3" layout-pos-x="14311" layout-pos-y="11274" layout-size-height="5809" layout-size-width="12297"/></layout>
+<layout type="AUTOLAYOUT_TITLE_4SCONTENT"><presobj kind="PRESOBJ_TITLE" layout-pos-x="1400" layout-pos-y="837" layout-size-height="4400" layout-size-width="25600"/><presobj kind="PRESOBJ_OUTLINE1" layout-pos-x="1400" layout-pos-y="4914" layout-size-height="5809" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE2" layout-pos-x="14311" layout-pos-y="5914" layout-size-height="4509" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE3" layout-pos-x="14311" layout-pos-y="12274" layout-size-height="4509" layout-size-width="12297"/><presobj kind="PRESOBJ_OUTLINE4" layout-pos-x="1400" layout-pos-y="11274" layout-size-height="5809" layout-size-width="12297"/></layout>
</layout-list>
\ No newline at end of file
More information about the Libreoffice-commits
mailing list