summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorPalenik Mihály <palenik.mihaly@gmail.com>2014-07-11 09:05:53 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-07-11 15:05:36 +0000
commitbfdacadec9a6472826a23ef86d5ebe21794e1bf9 (patch)
tree77d395495fd82b239a7fe92f9bbbf6e9a506aa5b /sfx2/source
parentf86a4b4897814f9eea4116816e9163bf71a62262 (diff)
Convert DLG_TEMPLATE_INFORMATION to .ui
Change-Id: I66469c17a46c1157b8e3801c0dc2b252c569a4bd Reviewed-on: https://gerrit.libreoffice.org/10213 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/dialog/templateinfodlg.cxx28
-rw-r--r--sfx2/source/dialog/templateinfodlg.hrc14
-rw-r--r--sfx2/source/dialog/templateinfodlg.src28
3 files changed, 9 insertions, 61 deletions
diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx
index 9437f3308e11..45dcd7837a74 100644
--- a/sfx2/source/dialog/templateinfodlg.cxx
+++ b/sfx2/source/dialog/templateinfodlg.cxx
@@ -24,10 +24,6 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
-#include "templateinfodlg.hrc"
-
-#define DLG_BORDER_SIZE 12
-
using namespace ::com::sun::star;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::document;
@@ -37,34 +33,28 @@ using namespace ::com::sun::star::task;
using namespace ::com::sun::star::util;
SfxTemplateInfoDlg::SfxTemplateInfoDlg (Window *pParent)
- : ModalDialog(pParent,SfxResId(DLG_TEMPLATE_INFORMATION)),
- maBtnClose(this,SfxResId(BTN_TEMPLATE_INFO_CLOSE)),
- mpPreviewView(new Window(this)),
- mpInfoView(new svtools::ODocumentInfoPreview(this,WB_LEFT | WB_VSCROLL | WB_READONLY | WB_BORDER | WB_3DLOOK))
+ : ModalDialog(pParent, "TemplateInfo", "sfx/ui/templateinfodialog.ui")
{
- maBtnClose.SetClickHdl(LINK(this,SfxTemplateInfoDlg,CloseHdl));
+ get(mpBtnClose, "close");
+ get(mpBox, "box");
+ get(mpInfoView, "infoDrawingArea");
+ mpPreviewView = new Window(mpBox);
- Size aWinSize = GetOutputSizePixel();
- aWinSize.setHeight( aWinSize.getHeight() - 3*DLG_BORDER_SIZE - maBtnClose.GetOutputHeightPixel() );
- aWinSize.setWidth( (aWinSize.getWidth() - 3*DLG_BORDER_SIZE)/2 );
- mpInfoView->SetPosSizePixel(Point(DLG_BORDER_SIZE,DLG_BORDER_SIZE),aWinSize);
+ Size aSize(LogicToPixel(Size(250, 160), MAP_APPFONT));
+ mpBox->set_width_request(aSize.Width());
+ mpBox->set_height_request(aSize.Height());
- mpPreviewView->SetPosSizePixel(Point(aWinSize.getWidth()+2*DLG_BORDER_SIZE,DLG_BORDER_SIZE),aWinSize);
+ mpBtnClose->SetClickHdl(LINK(this,SfxTemplateInfoDlg,CloseHdl));
xWindow = VCLUnoHelper::GetInterface(mpPreviewView);
m_xFrame = Frame::create( comphelper::getProcessComponentContext() );
m_xFrame->initialize( xWindow );
-
- mpPreviewView->Show();
- mpInfoView->Show();
}
SfxTemplateInfoDlg::~SfxTemplateInfoDlg()
{
m_xFrame->dispose();
-
- delete mpInfoView;
}
void SfxTemplateInfoDlg::loadDocument(const OUString &rURL)
diff --git a/sfx2/source/dialog/templateinfodlg.hrc b/sfx2/source/dialog/templateinfodlg.hrc
deleted file mode 100644
index 7d2fa6f99047..000000000000
--- a/sfx2/source/dialog/templateinfodlg.hrc
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#define DLG_TEMPLATE_INFORMATION 400
-
-#define BTN_TEMPLATE_INFO_CLOSE 11
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/templateinfodlg.src b/sfx2/source/dialog/templateinfodlg.src
deleted file mode 100644
index f012965b8a3f..000000000000
--- a/sfx2/source/dialog/templateinfodlg.src
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#include "templateinfodlg.hrc"
-
-ModalDialog DLG_TEMPLATE_INFORMATION
-{
- OutputSize = TRUE;
- SVLook = TRUE;
- Size = MAP_APPFONT( 250, 180 );
- Moveable = TRUE;
- Closeable = TRUE;
-
- PushButton BTN_TEMPLATE_INFO_CLOSE
- {
- Pos = MAP_APPFONT( 194, 160 );
- Size = MAP_APPFONT( 50, 14 );
- Text [ en-US ] = "Close";
- };
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */