cui/source/dialogs/insdlg.cxx | 16 ++++ cui/source/inc/insdlg.hxx | 1 cui/uiconfig/ui/insertoleobject.ui | 131 ++++++++++++++++++++----------------- fpicker/inc/bitmaps.hlst | 2 svtools/inc/bitmaps.hlst | 2 5 files changed, 92 insertions(+), 60 deletions(-)
New commits: commit f505f95d466d4d3348f41dfd93e5c243d15c6c71 Author: Caolán McNamara <[email protected]> Date: Tue May 9 13:27:06 2017 +0100 Resolves: tdf#62702 allow ole objects to be inserted as icons under windows on "create new", "further objects" you get the native windows insert object dialog which has the "Display As Icon" option, but on Linux etc (or using our own dialog) there isn't that option so add a "Display as icon" checkbox in our own dialog and generate an icon through SvFileInformationManager::GetImage Change-Id: I0a400189031900bd1e387465ec4ba57847cb5394 diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx index 512cf89f908b..ca663f9996ed 100644 --- a/cui/source/dialogs/insdlg.cxx +++ b/cui/source/dialogs/insdlg.cxx @@ -34,6 +34,7 @@ #include "insdlg.hxx" #include <dialmgr.hxx> +#include <svtools/imagemgr.hxx> #include <svtools/sores.hxx> #include <tools/urlobj.hxx> @@ -164,6 +165,7 @@ SvInsertOleDlg::SvInsertOleDlg get(m_pEdFilepath, "urled"); get(m_pBtnFilepath, "urlbtn"); get(m_pCbFilelink, "linktofile"); + get(m_pCbAsIcon, "asicon"); m_pLbObjecttype->SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) ); m_pBtnFilepath->SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) ); Link<Button*,void> aLink( LINK( this, SvInsertOleDlg, RadioHdl ) ); @@ -188,6 +190,7 @@ void SvInsertOleDlg::dispose() m_pEdFilepath.clear(); m_pBtnFilepath.clear(); m_pCbFilelink.clear(); + m_pCbAsIcon.clear(); InsertObjectDialog_Impl::dispose(); } @@ -328,6 +331,19 @@ short SvInsertOleDlg::Execute() aErr = aErr.replaceFirst( "%", aFileName ); ScopedVclPtrInstance<MessageDialog>(this, aErr)->Execute(); } + else + { + if (m_pCbAsIcon->IsChecked()) + { + //something nice here I guess would be to write the filename into + //the image with this icon above it + Image aImage = SvFileInformationManager::GetImage(aURL, true); + SvMemoryStream aTemp; + WriteDIBBitmapEx(aImage.GetBitmapEx(), aTemp); + m_aIconMetaFile = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aTemp.GetData()), aTemp.Seek(STREAM_SEEK_TO_END)); + m_aIconMediaType = "application/x-openoffice-bitmap;windows_formatname=\"Bitmap\""; + } + } } } diff --git a/cui/source/inc/insdlg.hxx b/cui/source/inc/insdlg.hxx index cd6a45a507ab..4b4277495004 100644 --- a/cui/source/inc/insdlg.hxx +++ b/cui/source/inc/insdlg.hxx @@ -64,6 +64,7 @@ class SvInsertOleDlg : public InsertObjectDialog_Impl VclPtr<Edit> m_pEdFilepath; VclPtr<PushButton> m_pBtnFilepath; VclPtr<CheckBox> m_pCbFilelink; + VclPtr<CheckBox> m_pCbAsIcon; const SvObjectServerList* m_pServers; css::uno::Sequence< sal_Int8 > m_aIconMetaFile; diff --git a/cui/uiconfig/ui/insertoleobject.ui b/cui/uiconfig/ui/insertoleobject.ui index 5ddf229e6d9d..1aaeecb9319a 100644 --- a/cui/uiconfig/ui/insertoleobject.ui +++ b/cui/uiconfig/ui/insertoleobject.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> +<!-- Generated with glade 3.20.0 --> <interface> <requires lib="gtk+" version="3.0"/> <object class="GtkDialog" id="InsertOLEObjectDialog"> @@ -12,6 +12,63 @@ <property name="can_focus">False</property> <property name="orientation">vertical</property> <property name="spacing">12</property> + <child internal-child="action_area"> + <object class="GtkButtonBox" id="dialog-action_area1"> + <property name="can_focus">False</property> + <property name="layout_style">end</property> + <child> + <object class="GtkButton" id="ok"> + <property name="label">gtk-ok</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="can_default">True</property> + <property name="has_default">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkButton" id="cancel"> + <property name="label">gtk-cancel</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> + </child> + <child> + <object class="GtkButton" id="help"> + <property name="label">gtk-help</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + <property name="secondary">True</property> + </packing> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="pack_type">end</property> + <property name="position">1</property> + </packing> + </child> <child> <object class="GtkBox" id="box1"> <property name="width_request">400</property> @@ -162,6 +219,21 @@ <property name="top_attach">1</property> </packing> </child> + <child> + <object class="GtkCheckButton" id="asicon"> + <property name="label" translatable="yes">Display as icon</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="left_attach">0</property> + <property name="top_attach">2</property> + <property name="width">2</property> + </packing> + </child> </object> </child> </object> @@ -191,63 +263,6 @@ <property name="position">0</property> </packing> </child> - <child internal-child="action_area"> - <object class="GtkButtonBox" id="dialog-action_area1"> - <property name="can_focus">False</property> - <property name="layout_style">end</property> - <child> - <object class="GtkButton" id="ok"> - <property name="label">gtk-ok</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="can_default">True</property> - <property name="has_default">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> - <child> - <object class="GtkButton" id="help"> - <property name="label">gtk-help</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - <property name="secondary">True</property> - </packing> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="pack_type">end</property> - <property name="position">1</property> - </packing> - </child> </object> </child> <action-widgets> commit 077e053241b5dd19ee0b901473c2100550d1e3fe Author: Caolán McNamara <[email protected]> Date: Tue May 9 13:16:53 2017 +0100 folder.png is a different place than the others Change-Id: Ie607ab969dbd3a035b59bd9c44262d7ff69c2ed7 diff --git a/svtools/inc/bitmaps.hlst b/svtools/inc/bitmaps.hlst index 8948877de62a..c31034a41a88 100644 --- a/svtools/inc/bitmaps.hlst +++ b/svtools/inc/bitmaps.hlst @@ -108,7 +108,7 @@ #define BMP_OO_WRITER_TEMPLATE_LC "res/lx03255.png" #define BMP_EXTENSION_LC "res/lx03256.png" #define BMP_PLUGIN "res/plugin.png" -#define RID_BMP_FOLDER "res/folder.png" +#define RID_BMP_FOLDER "svtools/res/folder.png" #define RID_BMP_FOLDER_OPEN "res/folderop.png" #define RID_BMP_TREENODE_COLLAPSED "res/plus.png" #define RID_BMP_TREENODE_EXPANDED "res/minus.png" commit 0e32a434ef4d30d6d01cdce0f627fd32b249a1ff Author: Caolán McNamara <[email protected]> Date: Tue May 9 13:15:32 2017 +0100 fp010 is not in fpicker like the others Change-Id: I4c574596a4aaaf7584818e167805748dd02cff6c diff --git a/fpicker/inc/bitmaps.hlst b/fpicker/inc/bitmaps.hlst index a0cdf0124d34..61d5b71186de 100644 --- a/fpicker/inc/bitmaps.hlst +++ b/fpicker/inc/bitmaps.hlst @@ -10,7 +10,7 @@ #ifndef INCLUDED_FPICKER_INC_BITMAPS_HRC #define INCLUDED_FPICKER_INC_BITMAPS_HRC -#define BMP_FILEDLG_BTN_UP "fpicker/res/fp010.png" +#define BMP_FILEDLG_BTN_UP "res/fp010.png" #define BMP_FILEDLG_CREATEFOLDER "fpicker/res/fp014.png" #define BMP_FILEDLG_PLACE_LOCAL "fpicker/res/fp015.png" #define BMP_FILEDLG_PLACE_REMOTE "fpicker/res/fp016.png"
_______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
