diff options
author | Ptyl Dragon <ptyl@cloudon.com> | 2013-10-23 10:05:15 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2013-10-23 11:37:17 +0200 |
commit | 4db91c7db633b2e141d340bead677458f2d511a7 (patch) | |
tree | ac6d1054cbbe1f4d126cd49b4b2b91f52e9df927 /sw/qa/tiledrendering/tiledrendering.cxx | |
parent | d2eb26b4979b18c0cad0a57d9081e9f4c367f9f7 (diff) |
tiled rendering file picker works
Change-Id: I9936b7d366c5f02a973927381480d064eba710c6
Diffstat (limited to 'sw/qa/tiledrendering/tiledrendering.cxx')
-rw-r--r-- | sw/qa/tiledrendering/tiledrendering.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
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 <vcl/vclmain.hxx> #include <vcl/field.hxx> #include <vcl/button.hxx> +#include <sfx2/filedlghelper.hxx> +#include <com/sun/star/ui/dialogs/TemplateDescription.hpp> +#include <com/sun/star/ui/dialogs/XFilePicker.hpp> +#include <sfx2/filedlghelper.hxx> 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<uno::XComponentContext> xContext = |