[Libreoffice-commits] core.git: compilerplugins/clang filter/Library_graphicfilter.mk filter/source include/svtools l10ntools/source svtools/Library_svt.mk svtools/qa svtools/source svtools/uiconfig svtools/UIConfig_svt.mk

Eike Rathke erack at redhat.com
Fri Sep 22 11:29:01 UTC 2017


 compilerplugins/clang/checkunusedparams.cxx          |    1 
 filter/Library_graphicfilter.mk                      |    1 
 filter/source/graphic/GraphicExportDialog.cxx        |  160 ------------
 filter/source/graphic/GraphicExportDialog.hxx        |   76 -----
 filter/source/graphic/Services.cxx                   |   12 
 filter/source/graphic/graphicfilter.component        |    3 
 include/svtools/GraphicExportOptionsDialog.hxx       |   73 -----
 l10ntools/source/gRun.sh                             |    2 
 svtools/Library_svt.mk                               |    1 
 svtools/UIConfig_svt.mk                              |    1 
 svtools/qa/unit/data/svtools-dialogs-test.txt        |    1 
 svtools/source/filter/GraphicExportOptionsDialog.cxx |  141 ----------
 svtools/uiconfig/ui/GraphicExportOptionsDialog.ui    |  253 -------------------
 13 files changed, 1 insertion(+), 724 deletions(-)

New commits:
commit d80ba7354c8cecd4cba7b92a9f925f2bd0d78dd1
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Sep 19 21:54:01 2017 +0200

    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 at libreoffice.org>
    Reviewed-by: Eike Rathke <erack at redhat.com>

diff --git a/compilerplugins/clang/checkunusedparams.cxx b/compilerplugins/clang/checkunusedparams.cxx
index 2e56d6e7bd2a..40f47191a5c6 100644
--- a/compilerplugins/clang/checkunusedparams.cxx
+++ b/compilerplugins/clang/checkunusedparams.cxx
@@ -391,7 +391,6 @@ bool CheckUnusedParams::VisitFunctionDecl(FunctionDecl const * decl) {
         || fqn == "textconversiondlgs::ChineseTranslation_UnoDialog::create"
         || fqn == "pcr::DefaultHelpProvider::Create"
         || fqn == "pcr::DefaultFormComponentInspectorModel::Create"
-        || fqn == "GraphicExportDialog::GraphicExportDialog"
         || fqn == "pcr::ObjectInspectorModel::Create"
         || fqn == "GraphicExportFilter::GraphicExportFilter"
         || fqn == "CertificateContainer::CertificateContainer"
diff --git a/filter/Library_graphicfilter.mk b/filter/Library_graphicfilter.mk
index e0e60357cb13..b6b760f1dbfc 100644
--- a/filter/Library_graphicfilter.mk
+++ b/filter/Library_graphicfilter.mk
@@ -48,7 +48,6 @@ $(eval $(call gb_Library_use_libraries,graphicfilter,\
 
 $(eval $(call gb_Library_add_exception_objects,graphicfilter,\
 	filter/source/graphic/GraphicExportFilter \
-	filter/source/graphic/GraphicExportDialog \
 	filter/source/graphic/Services \
 ))
 
diff --git a/filter/source/graphic/GraphicExportDialog.cxx b/filter/source/graphic/GraphicExportDialog.cxx
deleted file mode 100644
index 2673ae6220cc..000000000000
--- a/filter/source/graphic/GraphicExportDialog.cxx
+++ /dev/null
@@ -1,160 +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 "GraphicExportDialog.hxx"
-
-#include <vcl/graphicfilter.hxx>
-#include <vcl/svapp.hxx>
-
-#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-
-#include <svtools/GraphicExportOptionsDialog.hxx>
-#include <unotools/syslocale.hxx>
-
-using namespace css;
-using namespace css::uno;
-using namespace css::beans;
-using namespace css::lang;
-
-GraphicExportDialog::GraphicExportDialog( const Reference< XComponentContext >& ) :
-    meFieldUnit(FUNIT_NONE),
-    mbSelectionOnly(false)
-{
-}
-
-GraphicExportDialog::~GraphicExportDialog()
-{
-}
-
-// XInitialization
-void SAL_CALL GraphicExportDialog::initialize( const Sequence<Any>& )
-{}
-
-// XPropertyAccess
-Sequence<PropertyValue> GraphicExportDialog::getPropertyValues()
-{
-    sal_Int32 i;
-    sal_Int32 nCount = maMediaDescriptor.getLength();
-
-    for ( i = 0; i < nCount; i++ )
-    {
-        if ( maMediaDescriptor[ i ].Name == "FilterData" )
-        {
-            break;
-        }
-    }
-
-    if ( i >= nCount )
-    {
-        nCount++;
-        maMediaDescriptor.realloc( nCount );
-    }
-
-    maMediaDescriptor[ i ].Name = "FilterData";
-    maMediaDescriptor[ i ].Value <<= maFilterDataSequence;
-    return maMediaDescriptor;
-}
-
-void GraphicExportDialog::setPropertyValues( const Sequence<PropertyValue>& aProps )
-{
-    maMediaDescriptor = aProps;
-
-    sal_Int32 i, nCount;
-    for ( i = 0, nCount = maMediaDescriptor.getLength(); i < nCount; i++ )
-    {
-        if ( maMediaDescriptor[ i ].Name == "FilterData" )
-        {
-            maMediaDescriptor[ i ].Value >>= maFilterDataSequence;
-        }
-        else if ( maMediaDescriptor[ i ].Name == "SelectionOnly" )
-        {
-            maMediaDescriptor[ i ].Value >>= mbSelectionOnly;
-        }
-    }
-}
-
-// XExecutableDialog
-void GraphicExportDialog::setTitle( const OUString& aTitle )
-{
-    maDialogTitle = aTitle;
-}
-
-sal_Int16 GraphicExportDialog::execute()
-{
-    sal_Int16 nReturn = ui::dialogs::ExecutableDialogResults::CANCEL;
-    ScopedVclPtrInstance< GraphicExportOptionsDialog > graphicExportOptionsDialog( Application::GetDefDialogParent(),
-            mxSourceDocument, mbSelectionOnly );
-    if (graphicExportOptionsDialog->Execute() == RET_OK )
-    {
-        maFilterDataSequence = graphicExportOptionsDialog->getFilterData();
-        nReturn = ui::dialogs::ExecutableDialogResults::OK;
-    }
-    return nReturn;
-}
-
-// XEmporter
-void GraphicExportDialog::setSourceDocument( const Reference<XComponent>& xDocument )
-{
-    mxSourceDocument = xDocument;
-
-    // try to set the corresponding metric unit
-    OUString aConfigPath;
-    Reference< XServiceInfo > xServiceInfo ( xDocument, UNO_QUERY );
-
-    if ( xServiceInfo.is() )
-    {
-        if ( xServiceInfo->supportsService("com.sun.star.presentation.PresentationDocument") )
-        {
-            aConfigPath = "Office.Impress/Layout/Other/MeasureUnit";
-        }
-        else if ( xServiceInfo->supportsService("com.sun.star.drawing.DrawingDocument") )
-        {
-            aConfigPath = "Office.Draw/Layout/Other/MeasureUnit";
-        }
-        else if ( xServiceInfo->supportsService("com.sun.star.sheet.SpreadsheetDocument") )
-        {
-            aConfigPath = "Office.Calc/Layout/Other/MeasureUnit";
-        }
-        else if ( xServiceInfo->supportsService("com.sun.star.text.TextDocument") || xServiceInfo->supportsService("com.sun.star.text.WebDocument") )
-        {
-            aConfigPath = "Office.Writer/Layout/Other/MeasureUnit";
-        }
-        if ( !aConfigPath.isEmpty() )
-        {
-            FilterConfigItem aConfigItem( aConfigPath );
-            OUString aPropertyName;
-            SvtSysLocale aSysLocale;
-
-            if ( aSysLocale.GetLocaleDataPtr()->getMeasurementSystemEnum() == MeasurementSystem::Metric )
-            {
-                aPropertyName = "Metric";
-            }
-            else
-            {
-                aPropertyName = "NonMetric";
-            }
-            meFieldUnit = (FieldUnit) aConfigItem.ReadInt32( aPropertyName, FUNIT_CM );
-        }
-    }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphic/GraphicExportDialog.hxx b/filter/source/graphic/GraphicExportDialog.hxx
deleted file mode 100644
index dcbb8e5bcd9d..000000000000
--- a/filter/source/graphic/GraphicExportDialog.hxx
+++ /dev/null
@@ -1,76 +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 .
- */
-
-#ifndef INCLUDED_FILTER_SOURCE_GRAPHIC_GRAPHICEXPORTDIALOG_HXX
-#define INCLUDED_FILTER_SOURCE_GRAPHIC_GRAPHICEXPORTDIALOG_HXX
-
-#include <tools/fldunit.hxx>
-#include <cppuhelper/implbase.hxx>
-#include <comphelper/processfactory.hxx>
-
-#include <com/sun/star/lang/XInitialization.hpp>
-#include <com/sun/star/beans/XPropertyAccess.hpp>
-#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/document/XExporter.hpp>
-
-using namespace css;
-using namespace css::uno;
-using namespace css::beans;
-using namespace css::lang;
-
-class GraphicExportDialog : public cppu::WeakImplHelper
-<
-    document::XExporter,
-    ui::dialogs::XExecutableDialog,
-    beans::XPropertyAccess,
-    lang::XInitialization
->
-{
-    Sequence<PropertyValue>         maMediaDescriptor;
-    Sequence<PropertyValue>         maFilterDataSequence;
-    Reference<XComponent>           mxSourceDocument;
-
-    OUString   maDialogTitle;
-    FieldUnit  meFieldUnit;
-    bool       mbSelectionOnly;
-
-public:
-
-    explicit GraphicExportDialog( const Reference<XComponentContext>& rxContext );
-    virtual ~GraphicExportDialog() override;
-
-    // XInitialization
-    virtual void SAL_CALL initialize( const Sequence<Any>& aArguments ) override;
-
-    // XPropertyAccess
-    virtual Sequence<PropertyValue> SAL_CALL getPropertyValues() override;
-    virtual void SAL_CALL setPropertyValues( const Sequence<PropertyValue>& aProps ) override;
-
-    // XExecuteDialog
-    virtual sal_Int16 SAL_CALL execute() override;
-    virtual void SAL_CALL setTitle( const OUString& aTitle ) override;
-
-    // XExporter
-    virtual void SAL_CALL setSourceDocument( const Reference<lang::XComponent>& xDocument ) override;
-};
-
-
-#endif // _GRAPHICEXPORTDIALOGUNO_HXX_
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/filter/source/graphic/Services.cxx b/filter/source/graphic/Services.cxx
index d4742acbd876..e32ef6e98948 100644
--- a/filter/source/graphic/Services.cxx
+++ b/filter/source/graphic/Services.cxx
@@ -17,12 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include "GraphicExportDialog.hxx"
 #include "GraphicExportFilter.hxx"
 #include <comphelper/servicedecl.hxx>
 
 #define GRAPHIC_EXPORT_FILTER_SERVICE "com.sun.star.comp.GraphicExportFilter"
-#define GRAPHIC_EXPORT_DIALOG_SERVICE "com.sun.star.comp.GraphicExportDialog"
 
 comphelper::service_decl::class_<GraphicExportFilter> const serviceGraphicExportFilter;
 const comphelper::service_decl::ServiceDecl graphicExportFilter(
@@ -30,12 +28,6 @@ const comphelper::service_decl::ServiceDecl graphicExportFilter(
     GRAPHIC_EXPORT_FILTER_SERVICE,
     "com.sun.star.document.ExportFilter" );
 
-comphelper::service_decl::class_<GraphicExportDialog> const serviceGraphicExportDialog;
-const comphelper::service_decl::ServiceDecl graphicExportDialog(
-    serviceGraphicExportDialog,
-    GRAPHIC_EXPORT_DIALOG_SERVICE,
-    "com.sun.star.ui.dialog.FilterOptionsDialog" );
-
 
 extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL graphicfilter_component_getFactory(
     sal_Char const* pImplementationName, void*, void*)
@@ -44,10 +36,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT void* SAL_CALL graphicfilter_component_getFactor
     {
         return comphelper::service_decl::component_getFactoryHelper( pImplementationName, {&graphicExportFilter} );
     }
-    else if ( rtl_str_compare (pImplementationName, GRAPHIC_EXPORT_DIALOG_SERVICE) == 0 )
-    {
-        return comphelper::service_decl::component_getFactoryHelper( pImplementationName, {&graphicExportDialog} );
-    }
     return nullptr;
 }
 
diff --git a/filter/source/graphic/graphicfilter.component b/filter/source/graphic/graphicfilter.component
index b812a1b0479f..14afb9377d02 100644
--- a/filter/source/graphic/graphicfilter.component
+++ b/filter/source/graphic/graphicfilter.component
@@ -22,7 +22,4 @@
   <implementation name="com.sun.star.comp.GraphicExportFilter">
     <service name="com.sun.star.document.ExportFilter"/>
   </implementation>
-  <implementation name="com.sun.star.comp.GraphicExportDialog">
-    <service name="com.sun.star.ui.dialog.FilterOptionsDialog"/>
-  </implementation>
 </component>
diff --git a/include/svtools/GraphicExportOptionsDialog.hxx b/include/svtools/GraphicExportOptionsDialog.hxx
deleted file mode 100644
index 2ed5dfdd7749..000000000000
--- a/include/svtools/GraphicExportOptionsDialog.hxx
+++ /dev/null
@@ -1,73 +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 .
- */
-
-#ifndef INCLUDED_SVTOOLS_GRAPHICEXPORTOPTIONSDIALOG_HXX
-#define INCLUDED_SVTOOLS_GRAPHICEXPORTOPTIONSDIALOG_HXX
-
-#include <vcl/fltcall.hxx>
-#include <vcl/dialog.hxx>
-#include <vcl/button.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/field.hxx>
-#include <vcl/layout.hxx>
-#include <vcl/lstbox.hxx>
-#include <vcl/msgbox.hxx>
-#include <vcl/scrbar.hxx>
-
-#include <svtools/DocumentToGraphicRenderer.hxx>
-
-#include <svtools/svtdllapi.h>
-
-class SVT_DLLPUBLIC GraphicExportOptionsDialog : public ModalDialog
-{
-private:
-    VclPtr<NumericField>    mpWidth;
-    VclPtr<NumericField>    mpHeight;
-    VclPtr<ComboBox>        mpResolution;
-
-    Size        mSize100mm;
-    double      mResolution;
-
-    DocumentToGraphicRenderer mRenderer;
-
-    sal_Int32   mCurrentPage;
-
-    void initialize();
-    void updateWidth();
-    void updateHeight();
-    void updateResolution();
-
-    double getViewWidthInch();
-    double getViewHeightInch();
-
-    DECL_LINK( widthModifiedHandle,       Edit&, void );
-    DECL_LINK( heightModifiedHandle,      Edit&, void );
-    DECL_LINK( resolutionModifiedHandle,  Edit&, void );
-
-public:
-    GraphicExportOptionsDialog( vcl::Window* pWindow,
-            const css::uno::Reference<css::lang::XComponent>& rxSourceDocument, bool bSelectionOnly );
-    virtual ~GraphicExportOptionsDialog() override;
-    virtual void dispose() override;
-    css::uno::Sequence<css::beans::PropertyValue> getFilterData();
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/l10ntools/source/gRun.sh b/l10ntools/source/gRun.sh
index d37fff547fea..20df6f846717 100755
--- a/l10ntools/source/gRun.sh
+++ b/l10ntools/source/gRun.sh
@@ -480,7 +480,7 @@ ${MYCMD} --base sfx2/uiconfig/ui --files alienwarndialog.ui bookmarkdialog.ui ch
 
 ${MYCMD} --base starmath/uiconfig/smath/ui --files alignmentdialog.ui catalogdialog.ui dockingelements.ui fontdialog.ui fontsizedialog.ui fonttypedialog.ui printeroptions.ui savedefaultsdialog.ui smathsettings.ui spacingdialog.ui symdefinedialog.ui
 
-${MYCMD} --base svtools/uiconfig/ui --files addresstemplatedialog.ui graphicexport.ui GraphicExportOptionsDialog.ui javadisableddialog.ui placeedit.ui printersetupdialog.ui querydeletedialog.ui restartdialog.ui wizarddialog.ui
+${MYCMD} --base svtools/uiconfig/ui --files addresstemplatedialog.ui graphicexport.ui javadisableddialog.ui placeedit.ui printersetupdialog.ui querydeletedialog.ui restartdialog.ui wizarddialog.ui
 
 ${MYCMD} --base svx/uiconfig/ui --files acceptrejectchangesdialog.ui addconditiondialog.ui adddataitemdialog.ui addinstancedialog.ui addmodeldialog.ui addnamespacedialog.ui addsubmissiondialog.ui asianphoneticguidedialog.ui chineseconversiondialog.ui chinesedictionary.ui colorwindow.ui compressgraphicdialog.ui crashreportdlg.ui datanavigator.ui deletefooterdialog.ui deleteheaderdialog.ui docking3deffects.ui dockingcolorreplace.ui dockingfontwork.ui docrecoverybrokendialog.ui docrecoveryprogressdialog.ui docrecoveryrecoverdialog.ui docrecoverysavedialog.ui extrustiondepthdialog.ui findreplacedialog.ui floatingcontour.ui floatingundoredo.ui fontworkgallerydialog.ui fontworkspacingdialog.ui formlinkwarndialog.ui headfootformatpage.ui imapdialog.ui linkwarndialog.ui namespacedialog.ui optgridpage.ui paralinespacingcontrol.ui passwd.ui querydeletecontourdialog.ui querydeleteobjectdialog.ui querydeletethemedialog.ui querymodifyimagemapchangesdialog.ui querynewcontourdialog.ui querysavecon
 tchangesdialog.ui querysaveimagemapchangesdialog.ui queryunlinkgraphicsdialog.ui redlinecontrol.ui redlinefilterpage.ui redlineviewpage.ui savemodifieddialog.ui sidebararea.ui sidebargraphic.ui sidebarinsert.ui sidebarline.ui sidebarparagraph.ui sidebarpossize.ui sidebarshadow.ui sidebarstylespanel.ui sidebartextpanel.ui textcontrolchardialog.ui textcontrolparadialog.ui xformspage.ui
 
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>


More information about the Libreoffice-commits mailing list