sd: keep a non-owning pointer to the OverridingShell
[LibreOffice.git] / sfx2 / source / dialog / dialoghelper.cxx
blob9585c8baac805d63fbbb127790bcac657d0da2d9
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/.
8 */
10 #include <unotools/localedatawrapper.hxx>
11 #include <sfx2/dialoghelper.hxx>
12 #include <tools/datetime.hxx>
13 #include <vcl/outdev.hxx>
15 Size getParagraphPreviewOptimalSize(const OutputDevice& rReference)
17 return rReference.LogicToPixel(Size(68, 112), MapMode(MapUnit::MapAppFont));
20 Size getDrawPreviewOptimalSize(const OutputDevice& rReference)
22 return rReference.LogicToPixel(Size(88, 42), MapMode(MapUnit::MapAppFont));
25 Size getPreviewStripSize(const OutputDevice& rReference)
27 return rReference.LogicToPixel(Size(70, 40), MapMode(MapUnit::MapAppFont));
30 Size getPreviewOptionsSize(const OutputDevice& rReference)
32 return rReference.LogicToPixel(Size(70, 27), MapMode(MapUnit::MapAppFont));
35 OUString getWidestDateTime(const LocaleDataWrapper& rWrapper, bool bWithSec)
37 Date aDate(22, 12, 2000);
38 tools::Time aTime(22, 59, 59);
39 DateTime aDateTime(aDate, aTime);
40 return formatDateTime(aDateTime, rWrapper, bWithSec);
43 OUString formatDateTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper, bool bWithSec)
45 return rWrapper.getDate(rDateTime) + " " + rWrapper.getTime(rDateTime, bWithSec);
48 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */