[Libreoffice-commits] core.git: sd/source sd/uiconfig

Samuel Mehrbrodt s.mehrbrodt at gmail.com
Thu May 9 12:29:52 PDT 2013


 sd/source/ui/dlg/PhotoAlbumDialog.cxx |   13 +--
 sd/uiconfig/simpress/ui/photoalbum.ui |  127 ++++++++++++++--------------------
 2 files changed, 57 insertions(+), 83 deletions(-)

New commits:
commit 97a055dfa7c85c8795dc9b55fb39a5b3448b29f2
Author: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>
Date:   Thu May 9 14:24:33 2013 +0200

    Related fdo#35546: Cosmetic fixes for Photo Album Dialog
    
    * Display spaces in filenames correctly
    * Adjust Spacing in Dialog
    * Remove the label showing the full path
    
    Change-Id: I5c5d3d54b7e21063628c4cdb4a92f534ec4a3088
    Reviewed-on: https://gerrit.libreoffice.org/3834
    Reviewed-by: Andras Timar <atimar at suse.com>
    Tested-by: Andras Timar <atimar at suse.com>

diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index fc4b256..2771166 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -55,9 +55,7 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(Window* pWindow, SdDrawDocument* pActDoc)
     get(pImg, "preview_img");
 
     get(pInsTypeCombo, "opt_combo");
-
     get(pASRCheck, "asr_check");
-    get(pFilenameLab, "filename_lab");
 
     pCancelBtn->SetClickHdl(LINK(this, SdPhotoAlbumDialog, CancelHdl));
     pCreateBtn->SetClickHdl(LINK(this, SdPhotoAlbumDialog, CreateHdl));
@@ -614,10 +612,10 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl)
 
             for ( sal_Int32 i = 0; i < aFilesArr.getLength(); i++ )
             {
-                // Store full path, show filename only
-                OUString sFileName = aFilesArr[i].copy(aFilesArr[i].lastIndexOf("/")).replaceAll("/","");
-                sal_Int16 nPos = pImagesLst->InsertEntry( sFileName );
-                pImagesLst->SetEntryData(nPos, (void*)new OUString(aFilesArr[i]));
+                // Store full path, show filename only. Use INetURLObject to display spaces in filename correctly
+                INetURLObject aUrl = INetURLObject(aFilesArr[i]);
+                sal_Int16 nPos = pImagesLst->InsertEntry( aUrl.GetLastName(INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8) );
+                pImagesLst->SetEntryData(nPos, (OUString*) new OUString(aUrl.GetMainURL(INetURLObject::DECODE_WITH_CHARSET, RTL_TEXTENCODING_UTF8)));
             }
         }
     }
@@ -726,7 +724,6 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, RemoveHdl)
 {
     pImagesLst->RemoveEntry( pImagesLst->GetSelectEntryPos() );
     pImg->SetImage(Image());
-    pFilenameLab->SetText("");
 
     if(pImagesLst->GetEntryCount() >= 1)
     {
@@ -774,7 +771,6 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl)
         GraphicFilter aCurFilter;
         Graphic aGraphic;
         INetURLObject aURLObj( sImgUrl );
-        pFilenameLab->SetText(sImgUrl);
 
         sal_uInt16 nFilter = GRFILTER_FORMAT_DONTKNOW;
 
@@ -820,7 +816,6 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, SelectHdl)
     else
     {
         pImg->SetImage(Image());
-        pFilenameLab->SetText("");
     }
 
     return 0;
diff --git a/sd/uiconfig/simpress/ui/photoalbum.ui b/sd/uiconfig/simpress/ui/photoalbum.ui
index 87304e3..352d4a2 100644
--- a/sd/uiconfig/simpress/ui/photoalbum.ui
+++ b/sd/uiconfig/simpress/ui/photoalbum.ui
@@ -74,7 +74,7 @@
                   <object class="GtkBox" id="box2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="margin_left">6</property>
+                    <property name="margin_left">12</property>
                     <property name="margin_top">6</property>
                     <property name="vexpand">True</property>
                     <property name="orientation">vertical</property>
@@ -305,93 +305,72 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="filename_lab">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="valign">end</property>
-                <property name="margin_left">6</property>
-                <property name="xalign">0</property>
-                <property name="justify">right</property>
-              </object>
-              <packing>
-                <property name="expand">False</property>
-                <property name="fill">True</property>
-                <property name="position">1</property>
-              </packing>
-            </child>
-            <child>
               <object class="GtkFrame" id="frame3">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="label_xalign">0</property>
                 <property name="shadow_type">none</property>
                 <child>
-                  <object class="GtkAlignment" id="alignment2">
+                  <object class="GtkGrid" id="grid5">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="top_padding">6</property>
-                    <property name="left_padding">12</property>
+                    <property name="margin_left">12</property>
+                    <property name="margin_top">6</property>
+                    <property name="column_spacing">12</property>
                     <child>
-                      <object class="GtkGrid" id="grid5">
+                      <object class="GtkLabel" id="label7">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="column_spacing">12</property>
-                        <child>
-                          <object class="GtkLabel" id="label7">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="label" translatable="yes">Slide Layout</property>
-                            <property name="use_underline">True</property>
-                            <property name="mnemonic_widget">opt_combo</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkComboBox" id="opt_combo">
-                            <property name="width_request">160</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="model">liststore2</property>
-                            <property name="active">0</property>
-                            <child>
-                              <object class="GtkCellRendererText" id="cellrenderertext1"/>
-                              <attributes>
-                                <attribute name="text">0</attribute>
-                              </attributes>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
-                            <property name="width">1</property>
-                            <property name="height">1</property>
-                          </packing>
-                        </child>
+                        <property name="label" translatable="yes">Slide Layout</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">opt_combo</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="opt_combo">
+                        <property name="width_request">160</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="model">liststore2</property>
+                        <property name="active">0</property>
                         <child>
-                          <object class="GtkCheckButton" id="asr_check">
-                            <property name="label" translatable="yes">Keep Aspect Ratio</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="receives_default">False</property>
-                            <property name="use_action_appearance">False</property>
-                            <property name="xalign">0</property>
-                            <property name="active">True</property>
-                            <property name="draw_indicator">True</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">1</property>
-                            <property name="width">2</property>
-                            <property name="height">1</property>
-                          </packing>
+                          <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                          <attributes>
+                            <attribute name="text">0</attribute>
+                          </attributes>
                         </child>
                       </object>
+                      <packing>
+                        <property name="left_attach">1</property>
+                        <property name="top_attach">0</property>
+                        <property name="width">1</property>
+                        <property name="height">1</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="asr_check">
+                        <property name="label" translatable="yes">Keep Aspect Ratio</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="xalign">0</property>
+                        <property name="active">True</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">0</property>
+                        <property name="top_attach">1</property>
+                        <property name="width">2</property>
+                        <property name="height">1</property>
+                      </packing>
                     </child>
                   </object>
                 </child>


More information about the Libreoffice-commits mailing list