summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPtyl Dragon <ptyl@cloudon.com>2013-10-23 10:05:15 +0200
committerJan Holesovsky <kendy@collabora.com>2013-10-23 11:37:17 +0200
commit4db91c7db633b2e141d340bead677458f2d511a7 (patch)
treeac6d1054cbbe1f4d126cd49b4b2b91f52e9df927
parentd2eb26b4979b18c0cad0a57d9081e9f4c367f9f7 (diff)
tiled rendering file picker works
Change-Id: I9936b7d366c5f02a973927381480d064eba710c6
-rw-r--r--sw/Executable_tiledrendering.mk1
-rw-r--r--sw/qa/tiledrendering/tiledrendering.cxx29
2 files changed, 28 insertions, 2 deletions
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 <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 =