diff options
author | Eike Rathke <erack@redhat.com> | 2017-09-19 21:54:01 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2017-09-22 13:28:31 +0200 |
commit | d80ba7354c8cecd4cba7b92a9f925f2bd0d78dd1 (patch) | |
tree | c00e2547d23e7ec3db711accfca7a0a8aa797dfc /svtools | |
parent | b9de047454c2603e2f5a5108254cd3f967e8a88b (diff) |
Ditch now unused GraphicExportDialog, GraphicExportOptionsDialog
That was a dead end anyway, trying to partly reimplement
SvFilterOptionsDialog ExportDialog, instead of implementing the
necessary bits to use that one which has everything.
Change-Id: Icde7422f2c2d7e26c07dfe921a4abda41e222b09
Reviewed-on: https://gerrit.libreoffice.org/42503
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/Library_svt.mk | 1 | ||||
-rw-r--r-- | svtools/UIConfig_svt.mk | 1 | ||||
-rw-r--r-- | svtools/qa/unit/data/svtools-dialogs-test.txt | 1 | ||||
-rw-r--r-- | svtools/source/filter/GraphicExportOptionsDialog.cxx | 141 | ||||
-rw-r--r-- | svtools/uiconfig/ui/GraphicExportOptionsDialog.ui | 253 |
5 files changed, 0 insertions, 397 deletions
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk index 08f182571690..8ac7f495c0a2 100644 --- a/svtools/Library_svt.mk +++ b/svtools/Library_svt.mk @@ -149,7 +149,6 @@ $(eval $(call gb_Library_add_exception_objects,svt,\ svtools/source/edit/svmedit2 \ svtools/source/edit/textwindowpeer \ svtools/source/filter/SvFilterOptionsDialog \ - svtools/source/filter/GraphicExportOptionsDialog \ svtools/source/filter/DocumentToGraphicRenderer \ svtools/source/filter/exportdialog \ svtools/source/graphic/descriptor \ diff --git a/svtools/UIConfig_svt.mk b/svtools/UIConfig_svt.mk index 3aeeff899dd8..1d20f6fe203c 100644 --- a/svtools/UIConfig_svt.mk +++ b/svtools/UIConfig_svt.mk @@ -13,7 +13,6 @@ $(eval $(call gb_UIConfig_add_uifiles,svt,\ svtools/uiconfig/ui/addresstemplatedialog \ svtools/uiconfig/ui/fileviewmenu \ svtools/uiconfig/ui/graphicexport \ - svtools/uiconfig/ui/GraphicExportOptionsDialog \ svtools/uiconfig/ui/javadisableddialog \ svtools/uiconfig/ui/placeedit \ svtools/uiconfig/ui/printersetupdialog \ diff --git a/svtools/qa/unit/data/svtools-dialogs-test.txt b/svtools/qa/unit/data/svtools-dialogs-test.txt index 8dad8ab190ec..518300488ef9 100644 --- a/svtools/qa/unit/data/svtools-dialogs-test.txt +++ b/svtools/qa/unit/data/svtools-dialogs-test.txt @@ -39,7 +39,6 @@ svt/ui/placeedit.ui svt/ui/printersetupdialog.ui svt/ui/restartdialog.ui svt/ui/graphicexport.ui -svt/ui/GraphicExportOptionsDialog.ui svt/ui/wizarddialog.ui svt/ui/querydeletedialog.ui svt/ui/javadisableddialog.ui diff --git a/svtools/source/filter/GraphicExportOptionsDialog.cxx b/svtools/source/filter/GraphicExportOptionsDialog.cxx deleted file mode 100644 index 60c3dc05bba4..000000000000 --- a/svtools/source/filter/GraphicExportOptionsDialog.cxx +++ /dev/null @@ -1,141 +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/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include <svtools/GraphicExportOptionsDialog.hxx> -#include <vcl/svapp.hxx> - -using namespace css::beans; -using namespace css::lang; -using namespace css::uno; - -GraphicExportOptionsDialog::GraphicExportOptionsDialog(vcl::Window* pWindow, - const Reference<XComponent>& rxSourceDocument, bool bSelectionOnly) : - ModalDialog(pWindow, "GraphicExporter", "svt/ui/GraphicExportOptionsDialog.ui"), - mResolution(96.0), - mRenderer(rxSourceDocument, bSelectionOnly) -{ - get(mpWidth, "spin-width"); - get(mpHeight, "spin-height"); - get(mpResolution, "combo-resolution"); - - mpWidth->SetModifyHdl( LINK( this, GraphicExportOptionsDialog, widthModifiedHandle )); - mpHeight->SetModifyHdl( LINK( this, GraphicExportOptionsDialog, heightModifiedHandle )); - mpResolution->SetModifyHdl( LINK( this, GraphicExportOptionsDialog, resolutionModifiedHandle )); - - initialize(); - - updateWidth(); - updateHeight(); - updateResolution(); -} - -GraphicExportOptionsDialog::~GraphicExportOptionsDialog() -{ - disposeOnce(); -} - -void GraphicExportOptionsDialog::dispose() -{ - mpWidth.clear(); - mpHeight.clear(); - mpResolution.clear(); - ModalDialog::dispose(); -} - -void GraphicExportOptionsDialog::initialize() -{ - mCurrentPage = mRenderer.getCurrentPage(); - mSize100mm = mRenderer.getDocumentSizeIn100mm(mCurrentPage); - // Init DPI with screen resolution, taking width. This may lead to unusual - // DPI values but ensures a size in pixels that matches the actual screen - // content, which is vital for example for Calc with drawing layer and - // pixel images. - Size aSizePixels = Application::GetDefaultDevice()->LogicToPixel( mSize100mm, MapUnit::Map100thMM ); - mResolution = aSizePixels.Width() / getViewWidthInch(); -} - -IMPL_LINK_NOARG( GraphicExportOptionsDialog, widthModifiedHandle, Edit&, void ) -{ - mResolution = mpWidth->GetValue() / getViewWidthInch(); - - updateHeight(); - updateResolution(); -} - -IMPL_LINK_NOARG( GraphicExportOptionsDialog, heightModifiedHandle, Edit&, void ) -{ - mResolution = mpHeight->GetValue() / getViewHeightInch(); - - updateWidth(); - updateResolution(); -} - -IMPL_LINK_NOARG( GraphicExportOptionsDialog, resolutionModifiedHandle, Edit&, void ) -{ - mResolution = mpResolution->GetText().toInt32(); - - updateWidth(); - updateHeight(); - Update(); -} - -double GraphicExportOptionsDialog::getViewWidthInch() -{ - return (double) MetricField::ConvertValue(mSize100mm.Width(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0; -} - -double GraphicExportOptionsDialog::getViewHeightInch() -{ - return (double) MetricField::ConvertValue(mSize100mm.Height(), 2, MapUnit::Map100thMM, FUNIT_INCH) / 100.0; -} - -void GraphicExportOptionsDialog::updateWidth() -{ - sal_Int32 aWidth = (sal_Int32)( getViewWidthInch() * mResolution ); - mpWidth->SetText( OUString::number( aWidth )); -} - -void GraphicExportOptionsDialog::updateHeight() -{ - sal_Int32 aHeight = (sal_Int32)( getViewHeightInch() * mResolution ); - mpHeight->SetText( OUString::number( aHeight )); -} - -void GraphicExportOptionsDialog::updateResolution() -{ - mpResolution->SetText( OUString::number( (sal_Int32) mResolution ) ); -} - -Sequence<PropertyValue> GraphicExportOptionsDialog::getFilterData() -{ - sal_Int32 aWidth = (sal_Int32)( getViewWidthInch() * mResolution ); - sal_Int32 aHeight = (sal_Int32)( getViewHeightInch() * mResolution ); - - Sequence<PropertyValue> aFilterData; - - aFilterData.realloc( 2 ); - aFilterData[ 0 ].Name = "PixelWidth"; - aFilterData[ 0 ].Value <<= aWidth; - aFilterData[ 1 ].Name = "PixelHeight"; - aFilterData[ 1 ].Value <<= aHeight; - - return aFilterData; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svtools/uiconfig/ui/GraphicExportOptionsDialog.ui b/svtools/uiconfig/ui/GraphicExportOptionsDialog.ui deleted file mode 100644 index 3215603551b1..000000000000 --- a/svtools/uiconfig/ui/GraphicExportOptionsDialog.ui +++ /dev/null @@ -1,253 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.18.3 --> -<interface domain="svt"> - <requires lib="gtk+" version="3.0"/> - <object class="GtkAdjustment" id="adjustment-height"> - <property name="upper">20000</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkAdjustment" id="adjustment-width"> - <property name="upper">20000</property> - <property name="step_increment">1</property> - <property name="page_increment">10</property> - </object> - <object class="GtkDialog" id="GraphicExporter"> - <property name="can_focus">False</property> - <property name="border_width">6</property> - <property name="title" translatable="yes" context="GraphicExportOptionsDialog|GraphicExporter">Image Options</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="orientation">vertical</property> - <property name="spacing">2</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="ok"> - <property name="label">gtk-ok</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_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkButton" id="cancel"> - <property name="label">gtk-cancel</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="use_stock">True</property> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</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="box1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkFrame" id="frame1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label_xalign">0</property> - <property name="shadow_type">none</property> - <child> - <object class="GtkAlignment" id="alignment1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="left_padding">12</property> - <child> - <object class="GtkGrid" id="grid1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="row_spacing">6</property> - <property name="column_spacing">12</property> - <child> - <object class="GtkLabel" id="label5"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">1</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|label5">Width:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label6"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">1</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|label6">Height:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="resolutionft"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">1</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|resolutionft">Resolution:</property> - </object> - <packing> - <property name="left_attach">0</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="spin-width"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="invisible_char">•</property> - <property name="adjustment">adjustment-width</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkSpinButton" id="spin-height"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="invisible_char">•</property> - <property name="adjustment">adjustment-height</property> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label2"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|label2">px</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label3"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|label3">px</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">1</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="label4"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="xalign">0</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|label4">DPI</property> - </object> - <packing> - <property name="left_attach">2</property> - <property name="top_attach">2</property> - </packing> - </child> - <child> - <object class="GtkComboBoxText" id="combo-resolution"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="has_entry">True</property> - <items> - <item>50</item> - <item>75</item> - <item>96</item> - <item>150</item> - <item>200</item> - <item>300</item> - <item>600</item> - </items> - <child internal-child="entry"> - <object class="GtkEntry" id="comboboxtext-entry4"> - <property name="can_focus">False</property> - <property name="hexpand">True</property> - <property name="invisible_char">•</property> - </object> - </child> - </object> - <packing> - <property name="left_attach">1</property> - <property name="top_attach">2</property> - </packing> - </child> - </object> - </child> - </object> - </child> - <child type="label"> - <object class="GtkLabel" id="label1"> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="label" translatable="yes" context="GraphicExportOptionsDialog|label1">Size</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - </child> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <placeholder/> - </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">ok</action-widget> - <action-widget response="0">cancel</action-widget> - </action-widgets> - </object> -</interface> |