summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-12-07 14:08:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-12-07 17:17:33 +0000
commit7243f7c706ceb49d6b3e4dfb8ff72ab43c65dd86 (patch)
treed82b84376113840eaea70aa056dc6f654a678592 /sdext
parent368116fb55eb83c9f8c7eb180044f848294638bb (diff)
loplugin:unusedmethods
Change-Id: I5497d5b39620ff9fde09af923d3e41dedbab3326 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143774 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext')
-rw-r--r--sdext/Library_PresentationMinimizer.mk1
-rw-r--r--sdext/source/minimizer/impoptimizer.cxx5
-rw-r--r--sdext/source/minimizer/informationdialog.cxx1
-rw-r--r--sdext/source/minimizer/informationdialog.hxx1
-rw-r--r--sdext/source/minimizer/optimizerdialog.hxx1
-rw-r--r--sdext/source/minimizer/unodialog.cxx309
-rw-r--r--sdext/source/minimizer/unodialog.hxx118
7 files changed, 3 insertions, 433 deletions
diff --git a/sdext/Library_PresentationMinimizer.mk b/sdext/Library_PresentationMinimizer.mk
index 5409d53a9c68..9118017a8cff 100644
--- a/sdext/Library_PresentationMinimizer.mk
+++ b/sdext/Library_PresentationMinimizer.mk
@@ -53,7 +53,6 @@ $(eval $(call gb_Library_add_exception_objects,PresentationMinimizer,\
sdext/source/minimizer/pppoptimizer \
sdext/source/minimizer/pppoptimizerdialog \
sdext/source/minimizer/pppoptimizertoken \
- sdext/source/minimizer/unodialog \
))
# vim:set noet sw=4 ts=4:
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index d8079a588775..572b6c6e6347 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
#include <com/sun/star/presentation/XPresentationPage.hpp>
+#include <com/sun/star/rendering/XBitmap.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
@@ -372,7 +373,7 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon
Reference< XGraphic > xGraphic;
if ( rGraphic.maUser[ 0 ].mbFillBitmap && rGraphic.maUser[ 0 ].mxPropertySet.is() )
{
- Reference< XBitmap > xFillBitmap;
+ Reference< rendering::XBitmap > xFillBitmap;
if ( rGraphic.maUser[ 0 ].mxPropertySet->getPropertyValue( "FillBitmap" ) >>= xFillBitmap )
xGraphic.set( xFillBitmap, UNO_QUERY_THROW );
}
@@ -413,7 +414,7 @@ static void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XCompon
}
else if ( rGraphicUser.mxPropertySet.is() )
{
- Reference< XBitmap > xFillBitmap( xNewGraphic, UNO_QUERY );
+ Reference< rendering::XBitmap > xFillBitmap( xNewGraphic, UNO_QUERY );
if ( xFillBitmap.is() )
{
awt::Size aSize;
diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx
index 0a6620dc02f7..ad6dc2b74548 100644
--- a/sdext/source/minimizer/informationdialog.cxx
+++ b/sdext/source/minimizer/informationdialog.cxx
@@ -34,7 +34,6 @@ using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
diff --git a/sdext/source/minimizer/informationdialog.hxx b/sdext/source/minimizer/informationdialog.hxx
index 6468ed575147..56c6994a2c8e 100644
--- a/sdext/source/minimizer/informationdialog.hxx
+++ b/sdext/source/minimizer/informationdialog.hxx
@@ -19,7 +19,6 @@
#pragma once
-#include "unodialog.hxx"
#include "configurationaccess.hxx"
#include <vcl/weld.hxx>
#include <com/sun/star/uno/XComponentContext.hpp>
diff --git a/sdext/source/minimizer/optimizerdialog.hxx b/sdext/source/minimizer/optimizerdialog.hxx
index 9eefb61e0b34..e36e5fe43262 100644
--- a/sdext/source/minimizer/optimizerdialog.hxx
+++ b/sdext/source/minimizer/optimizerdialog.hxx
@@ -20,7 +20,6 @@
#pragma once
#include <vector>
-#include "unodialog.hxx"
#include "optimizationstats.hxx"
#include "configurationaccess.hxx"
#include <com/sun/star/uno/Sequence.h>
diff --git a/sdext/source/minimizer/unodialog.cxx b/sdext/source/minimizer/unodialog.cxx
deleted file mode 100644
index a635d102e3b9..000000000000
--- a/sdext/source/minimizer/unodialog.cxx
+++ /dev/null
@@ -1,309 +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 "unodialog.hxx"
-
-#include <com/sun/star/awt/Toolkit.hpp>
-#include <com/sun/star/awt/UnoControlDialog.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-
-
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::view;
-using namespace ::com::sun::star::frame;
-using namespace ::com::sun::star::beans;
-
-UnoDialog::UnoDialog( const Reference< XComponentContext > &rxContext, Reference< XFrame > const & rxFrame ) :
- mxContext( rxContext ),
- mxController( rxFrame->getController() ),
- mxDialogModel( mxContext->getServiceManager()->createInstanceWithContext(
- "com.sun.star.awt.UnoControlDialogModel", mxContext ), UNO_SET_THROW ),
- mxDialogModelMultiPropertySet( mxDialogModel, UNO_QUERY_THROW ),
- mxDialogModelMSF( mxDialogModel, UNO_QUERY_THROW ),
- mxDialogModelNameContainer( mxDialogModel, UNO_QUERY_THROW ),
- mxDialogModelNameAccess( mxDialogModel, UNO_QUERY_THROW ),
- mxControlModel( mxDialogModel, UNO_QUERY_THROW ),
- mxDialog( UnoControlDialog::create(rxContext) ),
- mxControl( mxDialog, UNO_QUERY_THROW ),
- mbStatus( false )
-{
- mxControl->setModel( mxControlModel );
-
- Reference< XFrame > xFrame( mxController->getFrame() );
- Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() );
- Reference< XWindowPeer > xWindowPeer( xContainerWindow, UNO_QUERY_THROW );
-
- // set the main loop handle to update GUI while busy
- Reference< XToolkit > xToolkit( Toolkit::create( mxContext ), UNO_QUERY_THROW );
- mxReschedule.set( xToolkit, UNO_QUERY );
-
- // allocate the real window resources
- mxDialog->createPeer(xToolkit,
- xWindowPeer.is() ? xWindowPeer : xToolkit->getDesktopWindow());
-}
-
-UnoDialog::~UnoDialog()
-{
- // free the resources
- Reference<XComponent> xDialogComponent(mxDialog, UNO_QUERY_THROW);
- xDialogComponent->dispose();
-}
-
-void UnoDialog::execute()
-{
- mxDialog->setEnable( true );
- mxDialog->setVisible( true );
- mxDialog->execute();
-}
-
-void UnoDialog::endExecute( bool bStatus )
-{
- mbStatus = bStatus;
- mxDialog->endExecute();
-}
-
-Reference< XInterface > UnoDialog::insertControlModel( const OUString& rServiceName, const OUString& rName,
- const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XInterface > xControlModel;
- try
- {
- xControlModel = mxDialogModelMSF->createInstance( rServiceName );
- Reference< XMultiPropertySet > xMultiPropSet( xControlModel, UNO_QUERY_THROW );
- xMultiPropSet->setPropertyValues( rPropertyNames, rPropertyValues );
- mxDialogModelNameContainer->insertByName( rName, Any( xControlModel ) );
- }
- catch( Exception& )
- {
- }
- return xControlModel;
-}
-
-
-void UnoDialog::setVisible( const OUString& rName, bool bVisible )
-{
- try
- {
- Reference< XInterface > xControl( mxDialog->getControl( rName ), UNO_QUERY_THROW );
- Reference< XWindow > xWindow( xControl, UNO_QUERY_THROW );
- xWindow->setVisible( bVisible );
- }
- catch ( Exception& )
- {
- }
-}
-
-
-Reference< XButton > UnoDialog::insertButton( const OUString& rName, const Reference< XActionListener >& xActionListener,
- const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XButton > xButton;
- try
- {
- Reference< XInterface > xButtonModel( insertControlModel( "com.sun.star.awt.UnoControlButtonModel",
- rName, rPropertyNames, rPropertyValues ) );
- Reference< XPropertySet > xPropertySet( xButtonModel, UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xButton.set( mxDialog->getControl( rName ), UNO_QUERY_THROW );
-
- if ( xActionListener.is() )
- {
- xButton->addActionListener( xActionListener );
- xButton->setActionCommand( rName );
- }
- return xButton;
- }
- catch( Exception& )
- {
- }
- return xButton;
-}
-
-
-Reference< XFixedText > UnoDialog::insertFixedText( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XFixedText > xFixedText;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlFixedTextModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xFixedText.set( mxDialog->getControl( rName ), UNO_QUERY_THROW );
- }
- catch ( Exception& )
- {
- }
- return xFixedText;
-}
-
-
-Reference< XCheckBox > UnoDialog::insertCheckBox( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XCheckBox > xCheckBox;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlCheckBoxModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xCheckBox.set( mxDialog->getControl( rName ), UNO_QUERY_THROW );
- }
- catch ( Exception& )
- {
- }
- return xCheckBox;
-}
-
-
-Reference< XControl > UnoDialog::insertFormattedField( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XControl > xControl;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlFormattedFieldModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xControl.set( mxDialog->getControl( rName ), UNO_SET_THROW );
- }
- catch ( Exception& )
- {
- }
- return xControl;
-}
-
-
-Reference< XComboBox > UnoDialog::insertComboBox( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XComboBox > xControl;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlComboBoxModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xControl.set( mxDialog->getControl( rName ), UNO_QUERY_THROW );
- }
- catch ( Exception& )
- {
- }
- return xControl;
-}
-
-
-Reference< XRadioButton > UnoDialog::insertRadioButton( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XRadioButton > xControl;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlRadioButtonModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xControl.set( mxDialog->getControl( rName ), UNO_QUERY_THROW );
- }
- catch ( Exception& )
- {
- }
- return xControl;
-}
-
-
-Reference< XListBox > UnoDialog::insertListBox( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XListBox > xControl;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlListBoxModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xControl.set( mxDialog->getControl( rName ), UNO_QUERY_THROW );
- }
- catch ( Exception& )
- {
- }
- return xControl;
-}
-
-
-Reference< XControl > UnoDialog::insertImage( const OUString& rName, const Sequence< OUString >& rPropertyNames, const Sequence< Any >& rPropertyValues )
-{
- Reference< XControl > xControl;
- try
- {
- Reference< XPropertySet > xPropertySet( insertControlModel( "com.sun.star.awt.UnoControlImageControlModel",
- rName, rPropertyNames, rPropertyValues ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue("Name", Any( rName ) );
- xControl.set( mxDialog->getControl( rName ), UNO_SET_THROW );
- }
- catch ( Exception& )
- {
- }
- return xControl;
-}
-
-
-void UnoDialog::setControlProperty( const OUString& rControlName, const OUString& rPropertyName, const Any& rPropertyValue )
-{
- try
- {
- if ( mxDialogModelNameAccess->hasByName( rControlName ) )
- {
- Reference< XPropertySet > xPropertySet( mxDialogModelNameAccess->getByName( rControlName ), UNO_QUERY_THROW );
- xPropertySet->setPropertyValue( rPropertyName, rPropertyValue );
- }
- }
- catch ( Exception& )
- {
- }
-}
-
-
-Any UnoDialog::getControlProperty( const OUString& rControlName, const OUString& rPropertyName )
-{
- Any aRet;
- try
- {
- if ( mxDialogModelNameAccess->hasByName( rControlName ) )
- {
- Reference< XPropertySet > xPropertySet( mxDialogModelNameAccess->getByName( rControlName ), UNO_QUERY_THROW );
- aRet = xPropertySet->getPropertyValue( rPropertyName );
- }
- }
- catch ( Exception& )
- {
- }
- return aRet;
-}
-
-
-void UnoDialog::enableControl( const OUString& rControlName )
-{
- setControlProperty( rControlName, "Enabled", Any( true ) );
-}
-
-
-void UnoDialog::disableControl( const OUString& rControlName )
-{
- setControlProperty( rControlName, "Enabled", Any( false ) );
-}
-
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/minimizer/unodialog.hxx b/sdext/source/minimizer/unodialog.hxx
deleted file mode 100644
index 3bf908cf15a9..000000000000
--- a/sdext/source/minimizer/unodialog.hxx
+++ /dev/null
@@ -1,118 +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_SDEXT_SOURCE_MINIMIZER_UNODIALOG_HXX
-#define INCLUDED_SDEXT_SOURCE_MINIMIZER_UNODIALOG_HXX
-
-#include <com/sun/star/uno/Sequence.h>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/beans/XMultiPropertySet.hpp>
-#include <com/sun/star/awt/XControl.hpp>
-#include <com/sun/star/awt/XControlModel.hpp>
-#include <com/sun/star/container/XNameContainer.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/awt/XActionListener.hpp>
-#include <com/sun/star/awt/XButton.hpp>
-#include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/XComboBox.hpp>
-#include <com/sun/star/awt/XRadioButton.hpp>
-#include <com/sun/star/awt/XListBox.hpp>
-#include <com/sun/star/awt/XFixedText.hpp>
-#include <com/sun/star/awt/XUnoControlDialog.hpp>
-#include <com/sun/star/awt/XReschedule.hpp>
-
-
-class UnoDialog
-{
-public:
-
- UnoDialog( const css::uno::Reference< css::uno::XComponentContext >& rxMSF, css::uno::Reference< css::frame::XFrame > const & rxFrame );
- ~UnoDialog();
-
- void execute();
- void endExecute( bool bStatus );
-
- css::uno::Reference< css::uno::XInterface > insertControlModel( const OUString& rServiceName, const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- void setVisible( const OUString& rName, bool bVisible );
-
- css::uno::Reference< css::awt::XButton > insertButton( const OUString& rName,
- const css::uno::Reference< css::awt::XActionListener >& xActionListener, const css::uno::Sequence< OUString >& rPropertyNames,
- const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XFixedText > insertFixedText( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XCheckBox > insertCheckBox( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XControl > insertFormattedField( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XComboBox > insertComboBox( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XRadioButton > insertRadioButton( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XListBox > insertListBox( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- css::uno::Reference< css::awt::XControl > insertImage( const OUString& rName,
- const css::uno::Sequence< OUString >& rPropertyNames, const css::uno::Sequence< css::uno::Any >& rPropertyValues );
-
- void setControlProperty( const OUString& rControlName, const OUString& rPropertyName, const css::uno::Any& rPropertyValue );
- css::uno::Any getControlProperty( const OUString& rControlName, const OUString& rPropertyName );
-
- void enableControl( const OUString& rControlName );
- void disableControl( const OUString& rControlName );
-
- void reschedule() const { mxReschedule->reschedule(); }
- bool endStatus() const { return mbStatus; }
- css::uno::Reference<css::awt::XControl> getControl(const OUString& rControlName) const { return mxDialog->getControl(rControlName); }
- const css::uno::Reference<css::frame::XController>& controller() const { return mxController; }
- void setPropertyValues(const css::uno::Sequence<OUString>& rNameSeq, const css::uno::Sequence<css::uno::Any>& rValueSeq)
- { mxDialogModelMultiPropertySet->setPropertyValues(rNameSeq, rValueSeq); }
-
-protected:
- css::uno::Reference< css::uno::XComponentContext > mxContext;
- css::uno::Reference< css::frame::XController > mxController;
-
-private:
- css::uno::Reference< css::awt::XReschedule > mxReschedule;
- css::uno::Reference< css::uno::XInterface > mxDialogModel;
- css::uno::Reference< css::beans::XMultiPropertySet > mxDialogModelMultiPropertySet;
- css::uno::Reference< css::lang::XMultiServiceFactory > mxDialogModelMSF;
- css::uno::Reference< css::container::XNameContainer > mxDialogModelNameContainer;
- css::uno::Reference< css::container::XNameAccess > mxDialogModelNameAccess;
-
- css::uno::Reference< css::awt::XControlModel > mxControlModel;
-
- css::uno::Reference< css::awt::XUnoControlDialog > mxDialog;
- css::uno::Reference< css::awt::XControl > mxControl;
- bool mbStatus;
-};
-
-#endif // INCLUDED_SDEXT_SOURCE_MINIMIZER_UNODIALOG_HXX
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */