sw: document SwFormatVertOrient
[LibreOffice.git] / vcl / workben / svdem.cxx
blob5c7cbb12ad89156516b50455e564cf7a930b53e2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <sal/main.h>
21 #include <sal/log.hxx>
22 #include <comphelper/diagnose_ex.hxx>
23 #include <tools/extendapplicationenvironment.hxx>
24 #include <cppuhelper/bootstrap.hxx>
25 #include <comphelper/processfactory.hxx>
26 #include <i18nlangtag/languagetag.hxx>
27 #include <i18nlangtag/mslangid.hxx>
28 #include <framework/desktop.hxx>
30 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <vcl/event.hxx>
34 #include <vcl/svapp.hxx>
35 #include <vcl/wrkwin.hxx>
37 using namespace ::com::sun::star::uno;
38 using namespace ::com::sun::star::lang;
39 using namespace cppu;
41 // Forward declaration
42 static void Main();
44 SAL_IMPLEMENT_MAIN()
46 try
48 tools::extendApplicationEnvironment();
50 Reference< XComponentContext > xContext = defaultBootstrap_InitialComponentContext();
51 Reference< XMultiServiceFactory > xServiceManager( xContext->getServiceManager(), UNO_QUERY );
53 if( !xServiceManager.is() )
54 Application::Abort( "Failed to bootstrap" );
56 comphelper::setProcessServiceFactory( xServiceManager );
58 LanguageTag::setConfiguredSystemLanguage(MsLangId::getSystemLanguage());
60 InitVCL();
61 ::Main();
63 framework::getDesktop(::comphelper::getProcessComponentContext())->terminate();
65 DeInitVCL();
67 catch (const Exception&)
69 TOOLS_WARN_EXCEPTION("vcl.app", "Fatal");
70 return 1;
72 catch (const std::exception &e)
74 fprintf(stderr, "fatal error: %s\n", e.what());
75 return 1;
78 return 0;
81 namespace {
83 class MyWin : public WorkWindow
85 public:
86 MyWin( vcl::Window* pParent, WinBits nWinStyle );
91 void Main()
93 ScopedVclPtrInstance< MyWin > aMainWin( nullptr, WB_APP | WB_STDWORK );
94 aMainWin->SetText("VCL - Workbench");
95 aMainWin->Show();
97 Application::Execute();
100 MyWin::MyWin( vcl::Window* pParent, WinBits nWinStyle ) :
101 WorkWindow( pParent, nWinStyle )
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */