[PATCH] Related fdo#35546: Cosmetic fixes for Photo Album Dialog

Samuel Mehrbrodt (via Code Review) gerrit at gerrit.libreoffice.org
Thu May 9 05:26:07 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3834

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/34/3834/1

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
---
M sd/source/ui/dlg/PhotoAlbumDialog.cxx
M sd/uiconfig/simpress/ui/photoalbum.ui
2 files changed, 57 insertions(+), 83 deletions(-)



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 @@
     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 @@
 
             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 @@
 {
     pImagesLst->RemoveEntry( pImagesLst->GetSelectEntryPos() );
     pImg->SetImage(Image());
-    pFilenameLab->SetText("");
 
     if(pImagesLst->GetEntryCount() >= 1)
     {
@@ -774,7 +771,6 @@
         GraphicFilter aCurFilter;
         Graphic aGraphic;
         INetURLObject aURLObj( sImgUrl );
-        pFilenameLab->SetText(sImgUrl);
 
         sal_uInt16 nFilter = GRFILTER_FORMAT_DONTKNOW;
 
@@ -820,7 +816,6 @@
     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>
+                        <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="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>
-                        <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>

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5c5d3d54b7e21063628c4cdb4a92f534ec4a3088
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Samuel Mehrbrodt <s.mehrbrodt at gmail.com>



More information about the LibreOffice mailing list