summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Deep <akshaydeepiitr@gmail.com>2016-03-17 21:30:53 +0530
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-04-26 14:01:26 +0000
commit0bdb8baf57ac243f574db6273eed70127379e3fc (patch)
tree8d20a0b316a9a19341a752527c9c7cc4fa21088c
parent56cd140064149b2055a2f50d86352d539b35bcad (diff)
tdf#64292 tdf#94639 Meaningless Functions in Template Properties Dialog
Removed useless Template Properties Dialog. Change-Id: I453abb67de9eb1515f98ff78cc7bebcc69482a1e Reviewed-on: https://gerrit.libreoffice.org/23339 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--include/sfx2/templatedlg.hxx2
-rw-r--r--include/sfx2/templateinfodlg.hxx53
-rw-r--r--sfx2/Library_sfx.mk1
-rw-r--r--sfx2/UIConfig_sfx.mk1
-rw-r--r--sfx2/source/dialog/templateinfodlg.cxx134
-rw-r--r--sfx2/source/doc/templatedlg.cxx18
-rw-r--r--sfx2/uiconfig/ui/templatedlg.ui14
-rw-r--r--sfx2/uiconfig/ui/templateinfodialog.ui82
8 files changed, 0 insertions, 305 deletions
diff --git a/include/sfx2/templatedlg.hxx b/include/sfx2/templatedlg.hxx
index ba3dbbf7ae55..74d7e0953976 100644
--- a/include/sfx2/templatedlg.hxx
+++ b/include/sfx2/templatedlg.hxx
@@ -25,7 +25,6 @@
class Edit;
class PopupMenu;
-class SfxTemplateInfoDlg;
class TemplateAbstractView;
class TemplateLocalView;
class TemplateRemoteView;
@@ -89,7 +88,6 @@ private:
static void OnTemplateLink ();
void OnTemplateOpen ();
void OnTemplateEdit ();
- void OnTemplateProperties ();
void OnTemplateDelete ();
void OnTemplateAsDefault ();
void OnTemplateExport ();
diff --git a/include/sfx2/templateinfodlg.hxx b/include/sfx2/templateinfodlg.hxx
deleted file mode 100644
index afa39e49135b..000000000000
--- a/include/sfx2/templateinfodlg.hxx
+++ /dev/null
@@ -1,53 +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/.
-*/
-
-#ifndef INCLUDED_SFX2_TEMPLATEINFODLG_HXX
-#define INCLUDED_SFX2_TEMPLATEINFODLG_HXX
-
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/layout.hxx>
-
-namespace svtools {
- class ODocumentInfoPreview;
-}
-
-namespace com{ namespace sun { namespace star { namespace awt { class XWindow; } } } }
-namespace com{ namespace sun { namespace star { namespace frame { class XFrame2; } } } }
-
-class SfxTemplateInfoDlg : public ModalDialog
-{
-public:
-
- SfxTemplateInfoDlg (vcl::Window *pParent = nullptr);
-
- virtual ~SfxTemplateInfoDlg();
- virtual void dispose() override;
-
- void loadDocument (const OUString &rURL);
-
-protected:
-
- DECL_LINK_TYPED(CloseHdl, Button*, void);
-
-private:
-
- VclPtr<PushButton> mpBtnClose;
- VclPtr<VclBox> mpBox;
-
- VclPtr<vcl::Window> mpPreviewView; // gets released when xWindows get destroyed (don't delete in constructor)
- VclPtr<svtools::ODocumentInfoPreview> mpInfoView;
-
- css::uno::Reference < css::frame::XFrame2 > m_xFrame;
- css::uno::Reference< css::awt::XWindow > xWindow;
-};
-
-#endif // INCLUDED_SFX2_TEMPLATEINFODLG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/Library_sfx.mk b/sfx2/Library_sfx.mk
index f4d61cd589d6..00af5abfe417 100644
--- a/sfx2/Library_sfx.mk
+++ b/sfx2/Library_sfx.mk
@@ -192,7 +192,6 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/dialog/styfitem \
sfx2/source/dialog/styledlg \
sfx2/source/dialog/tabdlg \
- sfx2/source/dialog/templateinfodlg \
sfx2/source/dialog/templdlg \
sfx2/source/dialog/titledockwin \
sfx2/source/dialog/tplcitem \
diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk
index 9a555b95b0d3..f33666988f96 100644
--- a/sfx2/UIConfig_sfx.mk
+++ b/sfx2/UIConfig_sfx.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/singletabdialog \
sfx2/uiconfig/ui/startcenter \
sfx2/uiconfig/ui/templatedlg \
- sfx2/uiconfig/ui/templateinfodialog \
sfx2/uiconfig/ui/versionsofdialog \
sfx2/uiconfig/ui/versioncommentdialog \
sfx2/uiconfig/ui/versionscmis \
diff --git a/sfx2/source/dialog/templateinfodlg.cxx b/sfx2/source/dialog/templateinfodlg.cxx
deleted file mode 100644
index 379d7047f2f3..000000000000
--- a/sfx2/source/dialog/templateinfodlg.cxx
+++ /dev/null
@@ -1,134 +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 <sfx2/templateinfodlg.hxx>
-
-#include <comphelper/processfactory.hxx>
-#include <sfx2/sfxresid.hxx>
-#include <svtools/DocumentInfoPreview.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/document/DocumentProperties.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/frame/Frame.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/task/InteractionHandler.hpp>
-#include <com/sun/star/util/URL.hpp>
-#include <com/sun/star/util/URLTransformer.hpp>
-#include <com/sun/star/util/XURLTransformer.hpp>
-
-using namespace ::com::sun::star;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::document;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::task;
-using namespace ::com::sun::star::util;
-
-SfxTemplateInfoDlg::SfxTemplateInfoDlg (vcl::Window *pParent)
- : ModalDialog(pParent, "TemplateInfo", "sfx/ui/templateinfodialog.ui")
-{
- get(mpBtnClose, "close");
- get(mpBox, "box");
- get(mpInfoView, "infoDrawingArea");
- mpPreviewView = VclPtr<vcl::Window>::Create(mpBox.get());
-
- Size aSize(LogicToPixel(Size(250, 160), MAP_APPFONT));
- mpBox->set_width_request(aSize.Width());
- mpBox->set_height_request(aSize.Height());
-
- mpBtnClose->SetClickHdl(LINK(this,SfxTemplateInfoDlg,CloseHdl));
-
- xWindow = VCLUnoHelper::GetInterface(mpPreviewView);
-
- m_xFrame = Frame::create( comphelper::getProcessComponentContext() );
- m_xFrame->initialize( xWindow );
-}
-
-SfxTemplateInfoDlg::~SfxTemplateInfoDlg()
-{
- disposeOnce();
-}
-
-void SfxTemplateInfoDlg::dispose()
-{
- m_xFrame->dispose();
- mpBtnClose.clear();
- mpBox.clear();
- mpPreviewView.clear();
- mpInfoView.clear();
- ModalDialog::dispose();
-}
-
-void SfxTemplateInfoDlg::loadDocument(const OUString &rURL)
-{
- assert(!rURL.isEmpty());
-
- uno::Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext());
-
- try
- {
- uno::Reference<task::XInteractionHandler2> xInteractionHandler(
- task::InteractionHandler::createWithParent(xContext, nullptr) );
-
- uno::Sequence<beans::PropertyValue> aProps(1);
- aProps[0].Name = "InteractionHandler";
- aProps[0].Value <<= xInteractionHandler;
-
- uno::Reference<document::XDocumentProperties> xDocProps(
- document::DocumentProperties::create(comphelper::getProcessComponentContext()) );
-
- xDocProps->loadFromMedium( rURL, aProps );
-
- mpInfoView->fill( xDocProps, rURL );
-
- // Create template preview
- uno::Reference<util::XURLTransformer > xTrans(
- util::URLTransformer::create(comphelper::getProcessComponentContext()));
-
- util::URL aURL;
- aURL.Complete = rURL;
- xTrans->parseStrict(aURL);
-
- uno::Reference<frame::XDispatch> xDisp = m_xFrame->queryDispatch( aURL, "_self", 0 );
-
- if ( xDisp.is() )
- {
- mpPreviewView->EnableInput( false );
-
- bool b = true;
- uno::Sequence <beans::PropertyValue> aArgs( 4 );
- aArgs[0].Name = "Preview";
- aArgs[0].Value.setValue( &b, cppu::UnoType<bool>::get() );
- aArgs[1].Name = "ReadOnly";
- aArgs[1].Value.setValue( &b, cppu::UnoType<bool>::get() );
- aArgs[2].Name = "AsTemplate"; // prevents getting an empty URL with getURL()!
- aArgs[3].Name = "InteractionHandler";
- aArgs[3].Value <<= xInteractionHandler;
-
- b = false;
- aArgs[2].Value.setValue( &b, cppu::UnoType<bool>::get() );
- xDisp->dispatch( aURL, aArgs );
- }
- }
- catch ( beans::UnknownPropertyException& )
- {
- }
- catch ( uno::Exception& )
- {
- }
-}
-
-IMPL_LINK_NOARG_TYPED(SfxTemplateInfoDlg, CloseHdl, Button*, void)
-{
- Close();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index e51bcb4de0e7..2b4f9b3daf6c 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -21,7 +21,6 @@
#include <sfx2/fcontnr.hxx>
#include <sfx2/filedlghelper.hxx>
#include <sfx2/sfxresid.hxx>
-#include <sfx2/templateinfodlg.hxx>
#include <sfx2/templatelocalview.hxx>
#include <sfx2/templatecontaineritem.hxx>
#include <sfx2/templateremoteview.hxx>
@@ -75,7 +74,6 @@ const char VIEWBAR_NEW_FOLDER[] = "new_folder";
const char TEMPLATEBAR_SAVE[] = "template_save";
const char TEMPLATEBAR_OPEN[] = "open";
const char TEMPLATEBAR_EDIT[] = "edit";
-const char TEMPLATEBAR_PROPERTIES[] = "properties";
const char TEMPLATEBAR_DEFAULT[] = "default";
const char TEMPLATEBAR_MOVE[] = "move";
const char TEMPLATEBAR_EXPORT[] = "export";
@@ -365,7 +363,6 @@ void SfxTemplateManagerDlg::setSaveMode()
mpViewBar->HideItem(VIEWBAR_REPOSITORY);
mpTemplateBar->ShowItem(TEMPLATEBAR_SAVE);
- mpTemplateBar->ShowItem(TEMPLATEBAR_PROPERTIES);
mpTemplateBar->ShowItem(TEMPLATEBAR_DEFAULT);
mpTemplateBar->HideItem(TEMPLATEBAR_OPEN);
mpTemplateBar->HideItem(TEMPLATEBAR_EDIT);
@@ -498,8 +495,6 @@ IMPL_LINK_NOARG_TYPED(SfxTemplateManagerDlg, TBXTemplateHdl, ToolBox *, void)
OnTemplateOpen();
else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_EDIT))
OnTemplateEdit();
- else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_PROPERTIES))
- OnTemplateProperties();
else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_DELETE))
OnTemplateDelete();
else if (nCurItemId == mpTemplateBar->GetItemId(TEMPLATEBAR_DEFAULT))
@@ -828,13 +823,11 @@ void SfxTemplateManagerDlg::OnTemplateState (const ThumbnailViewItem *pItem)
{
mpTemplateBar->HideItem(TEMPLATEBAR_OPEN);
mpTemplateBar->HideItem(TEMPLATEBAR_EDIT);
- mpTemplateBar->HideItem(TEMPLATEBAR_PROPERTIES);
mpTemplateBar->HideItem(TEMPLATEBAR_DEFAULT);
}
else
{
mpTemplateBar->HideItem(TEMPLATEBAR_SAVE);
- mpTemplateBar->HideItem(TEMPLATEBAR_PROPERTIES);
mpTemplateBar->HideItem(TEMPLATEBAR_DEFAULT);
}
if( !mbIsSaveMode )
@@ -863,13 +856,11 @@ void SfxTemplateManagerDlg::OnTemplateState (const ThumbnailViewItem *pItem)
{
mpTemplateBar->ShowItem(TEMPLATEBAR_OPEN);
mpTemplateBar->ShowItem(TEMPLATEBAR_EDIT);
- mpTemplateBar->ShowItem(TEMPLATEBAR_PROPERTIES);
mpTemplateBar->ShowItem(TEMPLATEBAR_DEFAULT);
}
else
{
mpTemplateBar->ShowItem(TEMPLATEBAR_SAVE);
- mpTemplateBar->ShowItem(TEMPLATEBAR_PROPERTIES);
mpTemplateBar->ShowItem(TEMPLATEBAR_DEFAULT);
}
mpOKButton->Enable();
@@ -1178,15 +1169,6 @@ void SfxTemplateManagerDlg::OnTemplateEdit ()
Close();
}
-void SfxTemplateManagerDlg::OnTemplateProperties ()
-{
- const TemplateViewItem *pItem = static_cast<const TemplateViewItem*>(*maSelTemplates.begin());
-
- ScopedVclPtrInstance< SfxTemplateInfoDlg > aDlg;
- aDlg->loadDocument(pItem->getPath());
- aDlg->Execute();
-}
-
void SfxTemplateManagerDlg::OnTemplateDelete ()
{
ScopedVclPtrInstance< MessageDialog > aQueryDlg(this, SfxResId(STR_QMSG_SEL_TEMPLATE_DELETE), VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO);
diff --git a/sfx2/uiconfig/ui/templatedlg.ui b/sfx2/uiconfig/ui/templatedlg.ui
index 29b5a9e7f143..0517ea32aa5f 100644
--- a/sfx2/uiconfig/ui/templatedlg.ui
+++ b/sfx2/uiconfig/ui/templatedlg.ui
@@ -221,20 +221,6 @@
</packing>
</child>
<child>
- <object class="GtkToolButton" id="properties">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="action_name">properties</property>
- <property name="label" translatable="yes">Properties</property>
- <property name="use_underline">True</property>
- <property name="icon_name">sfx2/imglst/actiontemplates016.png</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="homogeneous">True</property>
- </packing>
- </child>
- <child>
<object class="GtkToolButton" id="default">
<property name="visible">True</property>
<property name="can_focus">False</property>
diff --git a/sfx2/uiconfig/ui/templateinfodialog.ui b/sfx2/uiconfig/ui/templateinfodialog.ui
deleted file mode 100644
index 51405c552e5e..000000000000
--- a/sfx2/uiconfig/ui/templateinfodialog.ui
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
-<interface>
- <requires lib="gtk+" version="3.0"/>
- <requires lib="LibreOffice" version="1.0"/>
- <object class="GtkDialog" id="TemplateInfo">
- <property name="can_focus">False</property>
- <property name="border_width">6</property>
- <property name="title" translatable="yes">Template Properties</property>
- <property name="resizable">False</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox1">
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">12</property>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="can_focus">False</property>
- <property name="layout_style">end</property>
- <child>
- <object class="GtkButton" id="close">
- <property name="label" translatable="yes">_Close</property>
- <property name="use_action_appearance">False</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">True</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkBox" id="box">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- <property name="spacing">6</property>
- <property name="homogeneous">True</property>
- <child>
- <object class="svtlo-ODocumentInfoPreview" id="infoDrawingArea">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="vexpand">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="0">close</action-widget>
- </action-widgets>
- </object>
-</interface>