summaryrefslogtreecommitdiff
path: root/filter/source/graphic
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-09-19 21:54:01 +0200
committerEike Rathke <erack@redhat.com>2017-09-22 13:28:31 +0200
commitd80ba7354c8cecd4cba7b92a9f925f2bd0d78dd1 (patch)
treec00e2547d23e7ec3db711accfca7a0a8aa797dfc /filter/source/graphic
parentb9de047454c2603e2f5a5108254cd3f967e8a88b (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 'filter/source/graphic')
-rw-r--r--filter/source/graphic/GraphicExportDialog.cxx160
-rw-r--r--filter/source/graphic/GraphicExportDialog.hxx76
-rw-r--r--filter/source/graphic/Services.cxx12
-rw-r--r--filter/source/graphic/graphicfilter.component3
4 files changed, 0 insertions, 251 deletions
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>