diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-04-03 13:08:53 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:12 +0100 |
commit | ee657aeb53d5fb3bdd314b97a5b1e91d8ab92cc7 (patch) | |
tree | 9d2481447ac6edfd467235139e4aa89110ad52d8 /vcl/source/uipreviewer/previewer.cxx | |
parent | c0c1c262112966a1f743045ec185e7a4c875796b (diff) |
Implement "visible" from builder. Fix queueResize.
The natural place to call queueResize is from Window::StateChanged
=> instant-beautiful ui-previewer demo. ship it.
Diffstat (limited to 'vcl/source/uipreviewer/previewer.cxx')
-rw-r--r-- | vcl/source/uipreviewer/previewer.cxx | 30 |
1 files changed, 22 insertions, 8 deletions
diff --git a/vcl/source/uipreviewer/previewer.cxx b/vcl/source/uipreviewer/previewer.cxx index 9f3bdb27367a..7a27729f2c96 100644 --- a/vcl/source/uipreviewer/previewer.cxx +++ b/vcl/source/uipreviewer/previewer.cxx @@ -31,6 +31,7 @@ #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> #include <cppuhelper/bootstrap.hxx> +#include <osl/file.hxx> #include <ucbhelper/configurationkeys.hxx> #include <ucbhelper/contentbroker.hxx> #include <vcl/builder.hxx> @@ -49,7 +50,11 @@ int UIPreviewApp::Main() { std::vector<rtl::OUString> uifiles; for (sal_uInt16 i = 0; i < GetCommandLineParamCount(); ++i) - uifiles.push_back(GetCommandLineParam(i)); + { + rtl::OUString aFileUrl; + osl::File::getFileURLFromSystemPath(GetCommandLineParam(i), aFileUrl); + uifiles.push_back(aFileUrl); + } if (uifiles.empty()) { @@ -71,17 +76,26 @@ int UIPreviewApp::Main() aArgs[ 1 ] <<= rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(UCB_CONFIGURATION_KEY2_OFFICE)); ::ucbhelper::ContentBroker::initialize(xSFactory, aArgs); - VclBuilder aBuilder(NULL, uifiles[0]); - Window *pWindow = aBuilder.get_widget_root(); - Dialog *pDialog = dynamic_cast<Dialog*>(pWindow); - if (pDialog) + try { - pDialog->Execute(); + VclBuilder aBuilder(NULL, uifiles[0]); + Window *pWindow = aBuilder.get_widget_root(); + Dialog *pDialog = dynamic_cast<Dialog*>(pWindow); + if (pDialog) + { + pDialog->Execute(); + } + else + { + fprintf(stderr, "to-do: no toplevel dialog, make one\n"); + } } - else + catch (const uno::Exception &e) { - fprintf(stderr, "to-do: no toplevel dialog, make one\n"); + fprintf(stderr, "fatal error: \n", rtl::OUStringToOString(e.Message, osl_getThreadTextEncoding()).getStr()); } + return false; + ::ucbhelper::ContentBroker::deinitialize(); |