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

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Thu Jun 30 10:28:18 UTC 2016


 sd/source/ui/dlg/PhotoAlbumDialog.cxx |   39 +++++++++++++++++++++++++++-------
 sd/source/ui/dlg/PhotoAlbumDialog.hxx |    1 
 sd/uiconfig/simpress/ui/photoalbum.ui |   19 ++++++++++++++--
 3 files changed, 50 insertions(+), 9 deletions(-)

New commits:
commit 49f93558f073f97e33f3303ebca823a14e238e99
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Thu Jun 30 09:50:35 2016 +0200

    tdf#65356 Photo Album: Allow inserting images as link
    
    Change-Id: Ic7d1228b9e0a5ee5a303c5e3f4ce4d5a1b2b2036
    Reviewed-on: https://gerrit.libreoffice.org/26793
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 04a7b80..304ff9e 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -56,6 +56,8 @@ SdPhotoAlbumDialog::SdPhotoAlbumDialog(vcl::Window* pWindow, SdDrawDocument* pAc
     get(pInsTypeCombo, "opt_combo");
     get(pASRCheck, "asr_check");
     get(pCapCheck, "cap_check");
+    get(pInsertAsLinkCheck, "insert_as_link_check");
+
     pCancelBtn->SetClickHdl(LINK(this, SdPhotoAlbumDialog, CancelHdl));
     pCreateBtn->SetClickHdl(LINK(this, SdPhotoAlbumDialog, CreateHdl));
 
@@ -92,6 +94,7 @@ void SdPhotoAlbumDialog::dispose()
     pInsTypeCombo.clear();
     pASRCheck.clear();
     pCapCheck.clear();
+    pInsertAsLinkCheck.clear();
     ModalDialog::dispose();
 }
 
@@ -119,6 +122,7 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
         // determine if to use Captions (use TitleObject) and choose the correct AutoLayout
         // from the beginning
         const bool bCreateCaptions(pCapCheck->IsChecked());
+        const bool bInsertAsLink(pInsertAsLinkCheck->IsChecked());
         const AutoLayout aAutoLayout(bCreateCaptions ? AUTOLAYOUT_TITLE_ONLY : AUTOLAYOUT_NONE);
 
         // get the option
@@ -145,7 +149,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                     uno::UNO_QUERY);
 
                 Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                if (bInsertAsLink)
+                    xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl));
+                else
+                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                 ::awt::Size aPageSize;
 
@@ -220,7 +227,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                         uno::UNO_QUERY);
 
                     Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                    if (bInsertAsLink)
+                        xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl1));
+                    else
+                        xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                     ::awt::Point aPicPos;
 
@@ -255,7 +265,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                         uno::UNO_QUERY);
 
                     Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                    if (bInsertAsLink)
+                        xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl2));
+                    else
+                        xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                     ::awt::Point aPicPos;
 
@@ -335,7 +348,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                         uno::UNO_QUERY);
 
                     Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                    if (bInsertAsLink)
+                        xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl1));
+                    else
+                        xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                     ::awt::Point aPicPos;
 
@@ -369,7 +385,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                         uno::UNO_QUERY);
 
                     Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                    if (bInsertAsLink)
+                        xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl2));
+                    else
+                        xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                     ::awt::Point aPicPos;
 
@@ -404,7 +423,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                         uno::UNO_QUERY);
 
                     Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                    if (bInsertAsLink)
+                        xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl3));
+                    else
+                        xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                     ::awt::Point aPicPos;
 
@@ -438,7 +460,10 @@ IMPL_LINK_NOARG_TYPED(SdPhotoAlbumDialog, CreateHdl, Button*, void)
                         uno::UNO_QUERY);
 
                     Reference< beans::XPropertySet > xProps( xShape, uno::UNO_QUERY );
-                    xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
+                    if (bInsertAsLink)
+                        xProps->setPropertyValue("GraphicURL", ::uno::Any(sUrl4));
+                    else
+                        xProps->setPropertyValue("Graphic", ::uno::Any(xGraphic));
 
                     ::awt::Point aPicPos;
 
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.hxx b/sd/source/ui/dlg/PhotoAlbumDialog.hxx
index 8c35d55..dfdefb0 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.hxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.hxx
@@ -66,6 +66,7 @@ private:
     VclPtr<ListBox>    pInsTypeCombo;
     VclPtr<CheckBox>   pASRCheck;
     VclPtr<CheckBox>   pCapCheck;
+    VclPtr<CheckBox>   pInsertAsLinkCheck;
 
     SdDrawDocument* pDoc;
     GraphicFilter* mpGraphicFilter;
diff --git a/sd/uiconfig/simpress/ui/photoalbum.ui b/sd/uiconfig/simpress/ui/photoalbum.ui
index 7f25c2c..bda02f8 100644
--- a/sd/uiconfig/simpress/ui/photoalbum.ui
+++ b/sd/uiconfig/simpress/ui/photoalbum.ui
@@ -278,8 +278,8 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="margin_bottom">6</property>
-                        <property name="xalign">0</property>
                         <property name="label" translatable="yes">Preview</property>
+                        <property name="xalign">0</property>
                         <attributes>
                           <attribute name="weight" value="bold"/>
                         </attributes>
@@ -372,7 +372,22 @@
                       <packing>
                         <property name="expand">False</property>
                         <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="position">2</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkCheckButton" id="insert_as_link_check">
+                        <property name="label" translatable="yes">Link images</property>
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="receives_default">False</property>
+                        <property name="xalign">0</property>
+                        <property name="draw_indicator">True</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">True</property>
+                        <property name="position">3</property>
                       </packing>
                     </child>
                   </object>


More information about the Libreoffice-commits mailing list