Kaydet (Commit) 5cb68772 authored tarafından Jack Leigh's avatar Jack Leigh Kaydeden (comit) Caolán McNamara

migrate 'Insert OLE Object' dialog to use .ui file

Change-Id: If2a241e34f88a39bacee5344f89893e3ccfdc57d
üst 53acdd29
......@@ -13,6 +13,7 @@ $(eval $(call gb_UI_add_uifiles,cui,\
cui/uiconfig/ui/charnamepage \
cui/uiconfig/ui/effectspage \
cui/uiconfig/ui/hyphenate \
cui/uiconfig/ui/insertoleobject \
cui/uiconfig/ui/insertplugin \
cui/uiconfig/ui/positionpage \
cui/uiconfig/ui/specialcharacters \
......
......@@ -42,6 +42,7 @@
#include <vcl/button.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
#include <vcl/layout.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
......@@ -151,7 +152,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl)
{
Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
INetURLObject aObj( aPathSeq[0] );
aEdFilepath.SetText( aObj.PathToFileName() );
m_pEdFilepath->SetText( aObj.PathToFileName() );
}
}
}
......@@ -163,22 +164,15 @@ IMPL_LINK_NOARG(SvInsertOleDlg, BrowseHdl)
IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl)
{
if ( aRbNewObject.IsChecked() )
if ( m_pRbNewObject->IsChecked() )
{
aLbObjecttype.Show();
aEdFilepath.Hide();
aBtnFilepath.Hide();
aCbFilelink.Hide();
aGbObject.SetText( _aOldStr );
m_pObjectTypeFrame->Show();
m_pFileFrame->Hide();
}
else
{
aCbFilelink.Show();
aLbObjecttype.Hide();
aEdFilepath.Show();
aBtnFilepath.Show();
aCbFilelink.Show();
aGbObject.SetText( aStrFile );
m_pFileFrame->Show();
m_pObjectTypeFrame->Hide();
}
return 0;
}
......@@ -187,7 +181,7 @@ IMPL_LINK_NOARG(SvInsertOleDlg, RadioHdl)
void SvInsertOleDlg::SelectDefault()
{
aLbObjecttype.SelectEntryPos( 0 );
m_pLbObjecttype->SelectEntryPos(0);
}
// -----------------------------------------------------------------------
......@@ -197,30 +191,24 @@ SvInsertOleDlg::SvInsertOleDlg
const Reference < embed::XStorage >& xStorage,
const SvObjectServerList* pServers
)
: InsertObjectDialog_Impl( pParent, CUI_RES( MD_INSERT_OLEOBJECT ), xStorage ),
aRbNewObject( this, CUI_RES( RB_NEW_OBJECT ) ),
aRbObjectFromfile( this, CUI_RES( RB_OBJECT_FROMFILE ) ),
aGbObject( this, CUI_RES( GB_OBJECT ) ),
aLbObjecttype( this, CUI_RES( LB_OBJECTTYPE ) ),
aEdFilepath( this, CUI_RES( ED_FILEPATH ) ),
aBtnFilepath( this, CUI_RES( BTN_FILEPATH ) ),
aCbFilelink( this, CUI_RES( CB_FILELINK ) ),
aOKButton1( this, CUI_RES( 1 ) ),
aCancelButton1( this, CUI_RES( 1 ) ),
aHelpButton1( this, CUI_RES( 1 ) ),
aStrFile( CUI_RES( STR_FILE ) ),
: InsertObjectDialog_Impl( pParent, "InsertOLEObjectDialog", "cui/ui/insertoleobject.ui", xStorage ),
m_pServers( pServers )
{
FreeResource();
_aOldStr = aGbObject.GetText();
aLbObjecttype.SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) );
aBtnFilepath.SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) );
get(m_pRbNewObject, "createnew");
get(m_pRbObjectFromfile, "createfromfile");
get(m_pObjectTypeFrame, "objecttypeframe");
get(m_pLbObjecttype, "types");
get(m_pFileFrame, "fileframe");
get(m_pEdFilepath, "urled");
get(m_pBtnFilepath, "urlbtn");
get(m_pCbFilelink, "linktofile");
m_pLbObjecttype->SetDoubleClickHdl( LINK( this, SvInsertOleDlg, DoubleClickHdl ) );
m_pBtnFilepath->SetClickHdl( LINK( this, SvInsertOleDlg, BrowseHdl ) );
Link aLink( LINK( this, SvInsertOleDlg, RadioHdl ) );
aRbNewObject.SetClickHdl( aLink );
aRbObjectFromfile.SetClickHdl( aLink );
aRbNewObject.Check( sal_True );
m_pRbNewObject->SetClickHdl( aLink );
m_pRbObjectFromfile->SetClickHdl( aLink );
m_pRbNewObject->Check( sal_True );
RadioHdl( NULL );
aBtnFilepath.SetAccessibleRelationMemberOf(&aGbObject);
}
short SvInsertOleDlg::Execute()
......
......@@ -83,13 +83,6 @@
#define ED_APPLET_OPTIONS 20
#define GB_APPLET_OPTIONS 21
#define MD_INSERT_OLEOBJECT 32010
#define RB_NEW_OBJECT 10
#define RB_OBJECT_FROMFILE 11
#define LB_OBJECTTYPE 12
#define GB_OBJECT 13
#define STR_FILE 14
#define MD_INSERT_OBJECT_IFRAME 32011
#define FT_FRAMENAME 3
#define ED_FRAMENAME 4
......
......@@ -305,86 +305,6 @@ ModalDialog MD_LINKEDIT
Text [ en-US ] = "Edit" ;
};
};
ModalDialog MD_INSERT_OLEOBJECT
{
HelpID = "cui:ModalDialog:MD_INSERT_OLEOBJECT";
OutputSize = TRUE ;
SVLook = TRUE ;
Size = MAP_APPFONT ( 284 , 105 ) ;
Moveable = TRUE ;
RadioButton RB_NEW_OBJECT
{
HelpID = "cui:RadioButton:MD_INSERT_OLEOBJECT:RB_NEW_OBJECT";
Pos = MAP_APPFONT ( 6 , 6 ) ;
Size = MAP_APPFONT ( 81 , 10 ) ;
Text [ en-US ] = "~Create new" ;
};
RadioButton RB_OBJECT_FROMFILE
{
HelpID = "cui:RadioButton:MD_INSERT_OLEOBJECT:RB_OBJECT_FROMFILE";
Pos = MAP_APPFONT ( 90 , 6 ) ;
Size = MAP_APPFONT ( 81 , 10 ) ;
Text [ en-US ] = "Create from ~file" ;
};
ListBox LB_OBJECTTYPE
{
HelpID = "cui:ListBox:MD_INSERT_OLEOBJECT:LB_OBJECTTYPE";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 33 ) ;
Size = MAP_APPFONT ( 204 , 60 ) ;
};
Edit ED_FILEPATH
{
HelpID = "cui:Edit:MD_INSERT_OLEOBJECT:ED_FILEPATH";
Border = TRUE ;
Pos = MAP_APPFONT ( 12 , 33 ) ;
Size = MAP_APPFONT ( 204 , 12 ) ;
};
PushButton BTN_FILEPATH
{
HelpID = "cui:PushButton:MD_INSERT_OLEOBJECT:BTN_FILEPATH";
Pos = MAP_APPFONT ( 166 , 48 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
Text [ en-US ] = "~Search..." ;
};
CheckBox CB_FILELINK
{
HelpID = "cui:CheckBox:MD_INSERT_OLEOBJECT:CB_FILELINK";
Pos = MAP_APPFONT ( 12 , 48 ) ;
Size = MAP_APPFONT ( 138 , 10 ) ;
Text [ en-US ] = "~Link to file" ;
};
FixedLine GB_OBJECT
{
Pos = MAP_APPFONT ( 6 , 22 ) ;
Size = MAP_APPFONT ( 216 , 8 ) ;
Text [ en-US ] = "Object type" ;
};
OKButton 1
{
Pos = MAP_APPFONT ( 228 , 6 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
DefButton = TRUE ;
TabStop = TRUE ;
};
CancelButton 1
{
Pos = MAP_APPFONT ( 228 , 23 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
HelpButton 1
{
Pos = MAP_APPFONT ( 228 , 43 ) ;
Size = MAP_APPFONT ( 50 , 14 ) ;
TabStop = TRUE ;
};
String STR_FILE
{
Text [ en-US ] = "File" ;
};
Text [ en-US ] = "Insert OLE Object" ;
};
ModalDialog MD_INSERT_OBJECT_APPLET
{
HelpID = "cui:ModalDialog:MD_INSERT_OBJECT_APPLET";
......
......@@ -33,6 +33,8 @@
#include <svtools/svmedit.hxx> // MultiLineEdit
#include <comphelper/embeddedobjectcontainer.hxx>
class VclFrame;
class INetURLObject;
class InsertObjectDialog_Impl : public ModalDialog
......@@ -55,38 +57,37 @@ public:
class SvInsertOleDlg : public InsertObjectDialog_Impl
{
RadioButton aRbNewObject;
RadioButton aRbObjectFromfile;
FixedLine aGbObject;
ListBox aLbObjecttype;
Edit aEdFilepath;
PushButton aBtnFilepath;
CheckBox aCbFilelink;
OKButton aOKButton1;
CancelButton aCancelButton1;
HelpButton aHelpButton1;
String aStrFile;
String _aOldStr;
RadioButton* m_pRbNewObject;
RadioButton* m_pRbObjectFromfile;
VclFrame* m_pObjectTypeFrame;
ListBox* m_pLbObjecttype;
VclFrame* m_pFileFrame;
Edit* m_pEdFilepath;
PushButton* m_pBtnFilepath;
CheckBox* m_pCbFilelink;
const SvObjectServerList* m_pServers;
::com::sun::star::uno::Sequence< sal_Int8 > m_aIconMetaFile;
::rtl::OUString m_aIconMediaType;
OUString m_aIconMediaType;
DECL_LINK( DoubleClickHdl, void* );
DECL_LINK(DoubleClickHdl, void*);
DECL_LINK(BrowseHdl, void *);
DECL_LINK(RadioHdl, void *);
void SelectDefault();
ListBox& GetObjectTypes()
{ return aLbObjecttype; }
String GetFilePath() const { return aEdFilepath.GetText(); }
sal_Bool IsLinked() const { return aCbFilelink.IsChecked(); }
sal_Bool IsCreateNew() const { return aRbNewObject.IsChecked(); }
void SelectDefault();
ListBox& GetObjectTypes()
{ return *m_pLbObjecttype; }
OUString GetFilePath() const
{ return m_pEdFilepath->GetText(); }
sal_Bool IsLinked() const
{ return m_pCbFilelink->IsChecked(); }
sal_Bool IsCreateNew() const
{ return m_pRbNewObject->IsChecked(); }
public:
SvInsertOleDlg( Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
const SvObjectServerList* pServers = NULL );
virtual short Execute();
SvInsertOleDlg( Window* pParent,
const com::sun::star::uno::Reference < com::sun::star::embed::XStorage >& xStorage,
const SvObjectServerList* pServers = NULL );
virtual short Execute();
/// get replacement for the iconified embedded object and the mediatype of the replacement
::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > GetIconIfIconified( ::rtl::OUString* pGraphicMediaType );
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment