diff --git a/sw/Executable_tiledrendering.mk b/sw/Executable_tiledrendering.mk index c39b88b3ace3..d6d3da8203c2 100644 --- a/sw/Executable_tiledrendering.mk +++ b/sw/Executable_tiledrendering.mk @@ -28,6 +28,7 @@ $(eval $(call gb_Executable_use_libraries,tiledrendering,\ tl \ ucbhelper \ vcl \ + sfx \ sw \ )) diff --git a/sw/qa/tiledrendering/tiledrendering.cxx b/sw/qa/tiledrendering/tiledrendering.cxx index bfd20c327706..a6205a6ea521 100644 --- a/sw/qa/tiledrendering/tiledrendering.cxx +++ b/sw/qa/tiledrendering/tiledrendering.cxx @@ -21,6 +21,10 @@ #include #include #include +#include +#include +#include +#include class UIPreviewApp : public Application { @@ -29,7 +33,10 @@ public: virtual int Main(); }; -using namespace com::sun::star; +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::ui::dialogs; +using namespace ::sfx2; class TiledRenderingDialog: public ModalDialog{ public: @@ -38,6 +45,11 @@ public: PushButton * renderButton; get(renderButton,"buttonRenderTile"); renderButton->SetClickHdl( LINK( this, TiledRenderingDialog, RenderHdl)); + + PushButton * chooseDocumentButton; + get(chooseDocumentButton,"buttonChooseDocument"); + chooseDocumentButton->SetClickHdl( LINK( this, TiledRenderingDialog, ChooseDocumentHdl)); + SetStyle(GetStyle()|WB_CLOSEABLE); } virtual ~TiledRenderingDialog() @@ -45,13 +57,14 @@ public: } DECL_LINK ( RenderHdl, Button * ); + DECL_LINK ( ChooseDocumentHdl, Button * ); sal_Int32 extractInt(const char * name) { NumericField * pField; get(pField,name); OUString aString(pField->GetText()); - std::cerr << "param " << name << " returned " << aString <<"/n"; + std::cerr << "param " << name << " returned " << aString <<"\n"; return aString.toInt32(); } @@ -68,6 +81,18 @@ IMPL_LINK ( TiledRenderingDialog, RenderHdl, Button *, EMPTYARG ) return 1; } +IMPL_LINK ( TiledRenderingDialog, ChooseDocumentHdl, Button *, EMPTYARG ) +{ + FileDialogHelper aDlgHelper( TemplateDescription::FILEOPEN_SIMPLE, 0 ); + uno::Reference < XFilePicker > xFP = aDlgHelper.GetFilePicker(); + if( aDlgHelper.Execute() == ERRCODE_NONE ) + { + OUString aFilePath =xFP->getFiles().getConstArray()[0]; + std::cerr << aFilePath <<"\n"; + } + return 1; +} + void UIPreviewApp::Init() { uno::Reference xContext =