[PATCH] Create Photo Album fix

2013-05-03 Thread Andras Timar (via Code Review)
Hello LibreOffice gerrit bot,

I'd like you to reexamine a change.  Please visit

https://gerrit.libreoffice.org/3426

to look at the new patch set (#2).

Change subject: Create Photo Album fix
..

Create Photo Album fix

Fixed some pointer issues in CreateHdl function.
Removed the creation of title slide.
Added an enum to access the image layout option from the code.

Change-Id: Ib91fbbf3b068453c8e66b8df1ce32e24c3828bc0
---
M sd/source/ui/app/strings.src
M sd/source/ui/dlg/PhotoAlbumDialog.cxx
M sd/source/ui/dlg/PhotoAlbumDialog.hxx
M sd/source/ui/inc/strings.hrc
4 files changed, 43 insertions(+), 64 deletions(-)


  git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/3426/2
-- 
To view, visit https://gerrit.libreoffice.org/3426
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ib91fbbf3b068453c8e66b8df1ce32e24c3828bc0
Gerrit-PatchSet: 2
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Gergő Mocsi gmocs...@gmail.com
Gerrit-Reviewer: Andras Timar ati...@suse.com
Gerrit-Reviewer: LibreOffice gerrit bot ger...@libreoffice.org

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Create Photo Album fix

2013-05-03 Thread via Code Review
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3759

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/59/3759/1

Create Photo Album fix

Fixed some UI tweaks in handler function DownHdl: now images can me moved down 
correctly. Also, made some
simplification in handler UpHdl: I've moved forvard the declaration of local 
variable nActPos.

Change-Id: I879a6394865bb8442c0621dc2789efd9eedae87c
---
M sd/source/ui/dlg/PhotoAlbumDialog.cxx
1 file changed, 5 insertions(+), 5 deletions(-)



diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx 
b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 5d6ba1e..fc4b256 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -650,12 +650,12 @@
 if (pImagesLst-GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND
  pImagesLst-GetSelectEntryPos() != 0)
 {
-OUString sActEntry( 
pImagesLst-GetEntry(pImagesLst-GetSelectEntryPos()) );
+sal_uInt16 nActPos = pImagesLst-GetSelectEntryPos();
+OUString sActEntry( pImagesLst-GetEntry(nActPos) );
 // actual data
-OUString* pActData = (OUString*) 
pImagesLst-GetEntryData(pImagesLst-GetSelectEntryPos());
+OUString* pActData = (OUString*) pImagesLst-GetEntryData(nActPos);
 OUString sAct(*pActData);
 
-sal_uInt16 nActPos = pImagesLst-GetSelectEntryPos();
 OUString sUpperEntry( pImagesLst-GetEntry(nActPos - 1) );
 // upper data
 OUString* pUpperData = (OUString*) pImagesLst-GetEntryData(nActPos - 
1);
@@ -701,10 +701,10 @@
 pImagesLst-RemoveEntry( sDownEntry );
 
 pImagesLst-InsertEntry( sDownEntry, nActPos );
-pImagesLst-SetEntryData( nActPos, (void*) new OUString(sAct));
+pImagesLst-SetEntryData( nActPos, (void*) new OUString(sDown));
 
 pImagesLst-InsertEntry( sActEntry, nActPos + 1 );
-pImagesLst-SetEntryData( nActPos + 1, (void*) new OUString(sDown));
+pImagesLst-SetEntryData( nActPos + 1, (void*) new OUString(sAct));
 
 pImagesLst-SelectEntryPos(nActPos + 1);
 

-- 
To view, visit https://gerrit.libreoffice.org/3759
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I879a6394865bb8442c0621dc2789efd9eedae87c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Gergő Mocsi gmocs...@gmail.com

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice


[PATCH] Create Photo Album fix

2013-04-17 Thread via Code Review
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3426

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/26/3426/1

Create Photo Album fix

Fixed some pointer issues in CreateHdl function.
Removed the creation of title slide.
Added an enum to access the image layout option from the code.

Change-Id: Ib91fbbf3b068453c8e66b8df1ce32e24c3828bc0
---
M sd/source/ui/app/strings.src
M sd/source/ui/dlg/PhotoAlbumDialog.cxx
M sd/source/ui/dlg/PhotoAlbumDialog.hxx
M sd/source/ui/inc/strings.hrc
4 files changed, 43 insertions(+), 64 deletions(-)



diff --git a/sd/source/ui/app/strings.src b/sd/source/ui/app/strings.src
index a91003d..928e03e 100644
--- a/sd/source/ui/app/strings.src
+++ b/sd/source/ui/app/strings.src
@@ -1268,19 +1268,14 @@
  Text [ en-US ] = Drag and Drop Slides ;
 };
 
-String STR_PHOTO_ALBUM_TITLE
-{
- Text [ en-US ] = Photo Album ;
-};
-
-String STR_PHOTO_ALBUM_AUTHOR
-{
- Text [ en-US ] = Author: ;
-};
-
 String STR_PHOTO_ALBUM_EMPTY_WARNING
 {
  Text [ en-US ] = Please add images to the album. ;
 };
 
+String STR_PHOTO_ALBUM_TEXTBOX
+{
+Text [ en-US ] = Text Box;
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx 
b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 4beabeb..5d6ba1e 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -101,33 +101,12 @@
 Reference drawing::XDrawPages  xDrawPages( xDPS-getDrawPages(), 
uno::UNO_QUERY );
 Reference lang::XMultiServiceFactory  xShapeFactory( 
pDoc-getUnoModel(), uno::UNO_QUERY  );
 
-// Create the title slide
-const sal_Int32 nSlideCount = pDoc-GetSdPageCount(PK_STANDARD);
-
-if(nSlideCount == 1)
-{
-// we have created an empty presentation (probably)
-Reference drawing::XDrawPage  xTitleSlide = 
appendNewSlide(AUTOLAYOUT_TITLE, xDrawPages);
-
-SdPage* pFirstSlide = pDoc-GetSdPage( 
pDoc-GetSdPageCount(PK_STANDARD)-1, PK_STANDARD);
-SvtUserOptions aUserOptions;
-SdrObject* pTitleObj = pFirstSlide-GetPresObj(PRESOBJ_TITLE, 0);
-SvxShapeText* pTitleText = new SvxShapeText(pTitleObj);
-
pTitleText-SetShapeType(com.sun.star.presentation.TitleTextShape);
-pTitleText-setString(SD_RESSTR(STR_PHOTO_ALBUM_TITLE));
-
-SdrObject* pTextObj = pFirstSlide-GetPresObj(PRESOBJ_TEXT, 0);
-SvxShapeText* pTextShape = new SvxShapeText(pTextObj);
-pTextShape-SetShapeType(com.sun.star.presentation.TextShape);
-pTextShape-setString(SD_RESSTR(STR_PHOTO_ALBUM_AUTHOR) +   + 
aUserOptions.GetFullName());
-}
-
 Reference XComponentContext  
xContext(::comphelper::getProcessComponentContext());
 Reference graphic::XGraphicProvider 
xProvider(graphic::GraphicProvider::create(xContext));
 
 // get the option
-OUString sOpt = 
pInsTypeCombo-GetEntry(pInsTypeCombo-GetSelectEntryPos());
-if ( sOpt == Fit to slide)
+sal_uInt16 nOpt = pInsTypeCombo-GetSelectEntryPos();
+if ( nOpt == FIT_TO_SLIDE )
 {
 OUString sUrl;
 
@@ -184,11 +163,9 @@
 {
 appendNewSlide(AUTOLAYOUT_ONLY_TEXT, xDrawPages);
 }
-delete pData;
-pData = NULL;
 }
 }
-else if( sOpt == 1 image with title )
+else if( nOpt == TITLE_ONE_IMAGE )
 {
 OUString sUrl;
 
@@ -196,7 +173,7 @@
 {
 OUString* pData = (OUString*) pImagesLst-GetEntryData(i);
 sUrl = *pData;
-if ( sUrl != Text Box )
+if ( sUrl != SD_RESSTR(STR_PHOTO_ALBUM_TEXTBOX) )
 {
 
 Reference drawing::XDrawPage  xSlide = 
appendNewSlide(AUTOLAYOUT_NONE, xDrawPages);
@@ -227,11 +204,9 @@
 {
 appendNewSlide(AUTOLAYOUT_ONLY_TEXT, xDrawPages);
 }
-delete pData;
-pData = NULL;
 }
 }
-else if( sOpt == 2 images )
+else if( nOpt == TWO_IMAGES )
 {
 OUString sUrl1();
 OUString sUrl2();
@@ -252,13 +227,15 @@
 OUString(Height)) = aPageSize.Height;
 
 // grab the left one
-pData = (OUString*) pImagesLst-GetEntryData(i);
+void* pD1 = pImagesLst-GetEntryData(i);
+pData = (OUString*) pD1;
 sUrl1 = pData ? OUString(*pData) : ;
 // grab the right one
-pData = (OUString*) pImagesLst-GetEntryData(i+1);
+void* pD2 = pImagesLst-GetEntryData(i+1);
+pData = (OUString*) pD2;
 sUrl2 = pData ? OUString(*pData) : ;
 
-if( sUrl1 == Text Box ) //