summaryrefslogtreecommitdiff
path: root/sdext
diff options
context:
space:
mode:
authorAriel Constenla-Haile <arielch@apache.org>2013-03-15 22:19:19 +0000
committerAriel Constenla-Haile <arielch@apache.org>2013-03-15 22:19:19 +0000
commit8bdce6d900be92077b715ff1298b846ce32171b7 (patch)
treec7e8d3e7d31b66faaf8f73431e91425eb0eb7118 /sdext
parent0a6ba29e675385ce0aa49bb6ecd8d45b7aa0997b (diff)
i121872 - Integrate the Presentation Minimizer
Notes
Diffstat (limited to 'sdext')
-rw-r--r--sdext/prj/build.lst4
-rw-r--r--sdext/prj/d.lst26
-rw-r--r--sdext/source/minimizer/PresentationMinimizer.component (renamed from sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu)21
-rw-r--r--sdext/source/minimizer/configurationaccess.cxx198
-rw-r--r--sdext/source/minimizer/configurationaccess.hxx18
-rw-r--r--sdext/source/minimizer/delzip1
-rw-r--r--sdext/source/minimizer/description.xml58
-rw-r--r--sdext/source/minimizer/fileopendialog.cxx62
-rw-r--r--sdext/source/minimizer/fileopendialog.hxx6
-rw-r--r--sdext/source/minimizer/graphiccollector.cxx61
-rw-r--r--sdext/source/minimizer/graphiccollector.hxx6
-rw-r--r--sdext/source/minimizer/help/component.txt2
-rw-r--r--sdext/source/minimizer/help/help_de.odtbin8987 -> 0 bytes
-rw-r--r--sdext/source/minimizer/help/help_en-US.odtbin8987 -> 0 bytes
-rw-r--r--sdext/source/minimizer/helpid.hrc57
-rw-r--r--sdext/source/minimizer/impoptimizer.cxx93
-rw-r--r--sdext/source/minimizer/impoptimizer.hxx9
-rw-r--r--sdext/source/minimizer/informationdialog.cxx215
-rw-r--r--sdext/source/minimizer/informationdialog.hxx75
-rw-r--r--sdext/source/minimizer/makefile.mk158
-rw-r--r--sdext/source/minimizer/manifest.xml36
-rw-r--r--sdext/source/minimizer/minimizer.hrc95
-rw-r--r--sdext/source/minimizer/minimizer.pmk24
-rw-r--r--sdext/source/minimizer/minimizer.src379
-rw-r--r--sdext/source/minimizer/optimizationstats.cxx3
-rw-r--r--sdext/source/minimizer/optimizerdialog.cxx430
-rw-r--r--sdext/source/minimizer/optimizerdialog.hxx244
-rw-r--r--sdext/source/minimizer/optimizerdialogcontrols.cxx289
-rw-r--r--sdext/source/minimizer/pagecollector.cxx3
-rw-r--r--sdext/source/minimizer/pppoptimizer.cxx16
-rw-r--r--sdext/source/minimizer/pppoptimizer.hxx4
-rw-r--r--sdext/source/minimizer/pppoptimizerdialog.cxx194
-rw-r--r--sdext/source/minimizer/pppoptimizerdialog.hxx49
-rw-r--r--sdext/source/minimizer/pppoptimizertoken.cxx13
-rw-r--r--sdext/source/minimizer/pppoptimizertoken.hxx13
-rw-r--r--sdext/source/minimizer/pppoptimizeruno.cxx116
-rw-r--r--sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu86
-rw-r--r--sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu404
-rw-r--r--sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk46
-rw-r--r--sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk44
-rw-r--r--sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs346
-rw-r--r--sdext/source/minimizer/unodialog.cxx117
-rw-r--r--sdext/source/minimizer/unodialog.hxx44
43 files changed, 1852 insertions, 2213 deletions
diff --git a/sdext/prj/build.lst b/sdext/prj/build.lst
index 7462e4899e12..29350f7ca526 100644
--- a/sdext/prj/build.lst
+++ b/sdext/prj/build.lst
@@ -1,9 +1,7 @@
dx sdext : L10N:l10n offuh comphelper unotools readlicense_oo cppu tools cppuhelper sal javaunohelper officecfg LIBXSLT:libxslt xmlhelp NULL
dx sdext usr1 - all sdext_mkout NULL
dx sdext\prj get - all sdext_prj NULL
-dx sdext\source\minimizer nmake - all sdext_minimizer sdext_minimizer_rdoooe sdext_minimizer_rdooo sdext_inc NULL
-dx sdext\source\minimizer\registry\data\org\openoffice\Office\extension nmake - all sdext_minimizer_rdoooe NULL
-dx sdext\source\minimizer\registry\data\org\openoffice\Office nmake - all sdext_minimizer_rdooo NULL
+dx sdext\source\minimizer nmake - all sdext_minimizer sdext_inc NULL
dx sdext\source\presenter\registry\data\org\openoffice\Office\extension nmake - all sdext_presenter_xcu NULL
dx sdext\source\presenter\help\en-US\com.sun.PresenterScreen nmake - all sdext_presenter_help NULL
dx sdext\source\presenter nmake - all sdext_presenter sdext_inc sdext_presenter_xcu sdext_presenter_help NULL
diff --git a/sdext/prj/d.lst b/sdext/prj/d.lst
index bcaa4308bcb9..aacc8a5d041a 100644
--- a/sdext/prj/d.lst
+++ b/sdext/prj/d.lst
@@ -1,10 +1,30 @@
-mkdir: %_DEST%\bin%_EXT%\minimizer
mkdir: %_DEST%\bin%_EXT%\presenter
mkdir: %_DEST%\bin%_EXT%\pdfimport
..\%__SRC%\bin\pdf2xml.* %_DEST%\bin%_EXT%\pdf2xml.*
..\%__SRC%\bin\pdfunzip.* %_DEST%\bin%_EXT%\pdfunzip.*
..\%__SRC%\bin\pdfimport.oxt %_DEST%\bin%_EXT%\pdfimport\pdfimport.oxt
-..\%__SRC%\bin\presentation-minimizer.oxt %_DEST%\bin%_EXT%\minimizer\presentation-minimizer.oxt
-..\%__SRC%\bin\presentation_minimizer_develop.zip %_DEST%\bin%_EXT%\minimizer\presentation_minimizer_develop.zip
..\%__SRC%\bin\presenter-screen.oxt %_DEST%\bin%_EXT%\presenter\presenter-screen.oxt
..\%__SRC%\bin\presenter-screen_develop.zip %_DEST%\bin%_EXT%\presenter\presenter-screen_develop.zip
+
+
+
+mkdir: %COMMON_DEST%\res%_EXT%
+..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res
+
+mkdir: %_DEST%\xml%_EXT%
+mkdir: %_DEST%\xml%_EXT%\registry
+mkdir: %_DEST%\xml%_EXT%\registry\spool
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Addons
+mkdir: %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\ProtocolHandler
+
+..\%__SRC%\misc\registry\spool\org\openoffice\Office\Addons\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\Addons
+..\%__SRC%\misc\registry\spool\org\openoffice\Office\ProtocolHandler\*.xcu %_DEST%\xml%_EXT%\registry\spool\org\openoffice\Office\ProtocolHandler
+
+mkdir: %_DEST%\xml%_EXT%
+..\%__SRC%\misc\PresentationMinimizer.component %_DEST%\xml%_EXT%\PresentationMinimizer.component
+
+..\%__SRC%\bin\PresentationMinimizer*.dll %_DEST%\bin%_EXT%\PresentationMinimizer*.dll
+..\%__SRC%\lib\PresentationMinimizer*.so %_DEST%\lib%_EXT%
diff --git a/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu b/sdext/source/minimizer/PresentationMinimizer.component
index f2c541858192..2a243c2b6e55 100644
--- a/sdext/source/minimizer/registry/data/org/openoffice/Office/ProtocolHandler.xcu
+++ b/sdext/source/minimizer/PresentationMinimizer.component
@@ -1,4 +1,4 @@
-<?xml version='1.0' encoding='UTF-8'?>
+<?xml version="1.0" encoding="UTF-8"?>
<!--***********************************************************
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -19,13 +19,12 @@
* under the License.
*
***********************************************************-->
-
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="ProtocolHandler" oor:package="org.openoffice.Office">
- <node oor:name="HandlerSet">
- <node oor:name="com.sun.star.comp.SunPresentationMinimizerImp" oor:op="replace">
- <prop oor:name="Protocols" oor:type="oor:string-list">
- <value>vnd.com.sun.star.comp.SunPresentationMinimizer:*</value>
- </prop>
- </node>
- </node>
-</oor:component-data>
+<component loader="com.sun.star.loader.SharedLibrary"
+ xmlns="http://openoffice.org/2010/uno-components">
+ <implementation name="com.sun.star.comp.PPPOptimizerImp">
+ <service name="com.sun.star.comp.PPPOptimizer"/>
+ </implementation>
+ <implementation name="com.sun.star.comp.ui.dialogs.PresentationMinimizerDialog">
+ <service name="com.sun.star.ui.dialogs.PresentationMinimizerDialog"/>
+ </implementation>
+</component>
diff --git a/sdext/source/minimizer/configurationaccess.cxx b/sdext/source/minimizer/configurationaccess.cxx
index 48df1a3c4cc7..a0375a2b4af1 100644
--- a/sdext/source/minimizer/configurationaccess.cxx
+++ b/sdext/source/minimizer/configurationaccess.cxx
@@ -31,13 +31,39 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/util/XMacroExpander.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#include <com/sun/star/resource/XResourceBundleLoader.hpp>
+
+#include <rtl/ustrbuf.hxx>
+
+#include "minimizer.hrc"
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
+using rtl::OUString;
+using rtl::OUStringBuffer;
+
+
+#include <rtl/instance.hxx>
+
+typedef std::map < sal_Int32, rtl::OUString > StringResourceMap;
+
+struct StaticResourceMap
+ : public rtl::StaticWithInit< StringResourceMap, StaticResourceMap >
+{
+ StringResourceMap &
+ operator()() const;
+};
+
+StringResourceMap &
+StaticResourceMap::operator()() const
+{
+ static StringResourceMap aMap;
+ return aMap;
+}
+
static const OUString& GetConfigurationProviderServiceName (void)
{
static const OUString sConfigurationProviderServiceName (
@@ -48,10 +74,31 @@ static const OUString& GetConfigurationProviderServiceName (void)
static const OUString& GetPathToConfigurationRoot (void)
{
static const OUString sPathToConfigurationRoot (
- RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.extension.SunPresentationMinimizer"));
+ RTL_CONSTASCII_USTRINGPARAM("org.openoffice.Office.Impress/PresentationMinimizer"));
return sPathToConfigurationRoot;
}
+static OUString lcl_loadString(
+ const Reference< resource::XResourceBundle > xResourceBundle,
+ sal_Int32 nResourceId )
+{
+ OUString sString;
+ OUStringBuffer sKey;
+ sKey.appendAscii( RTL_CONSTASCII_STRINGPARAM( "string:" ) );
+ sKey.append( nResourceId );
+
+ try
+ {
+ OSL_VERIFY( xResourceBundle->getByName( sKey.makeStringAndClear() ) >>= sString );
+ }
+ catch( const uno::Exception& )
+ {
+ OSL_ENSURE( false, "OptimizerSettings: missing resource!" );
+ }
+
+ return sString;
+}
+
void OptimizerSettings::LoadSettingsFromConfiguration( const Reference< XNameAccess >& rSettings )
{
if ( rSettings.is() )
@@ -159,8 +206,8 @@ sal_Bool OptimizerSettings::operator==( const OptimizerSettings& rOptimizerSetti
}
-ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContext >& rxMSF, OptimizerSettings* pDefaultSettings ) :
- mxMSF( rxMSF )
+ConfigurationAccess::ConfigurationAccess( const Reference< uno::XComponentContext >& rxContext, OptimizerSettings* pDefaultSettings ) :
+ m_xContext( rxContext )
{
LoadStrings();
maSettings.push_back( pDefaultSettings ?
@@ -174,66 +221,101 @@ ConfigurationAccess::~ConfigurationAccess()
{
}
-rtl::OUString ConfigurationAccess::getPath( const PPPOptimizerTokenEnum eToken )
-{
- rtl::OUString aPath;
- try
- {
- static const OUString sProtocol( RTL_CONSTASCII_USTRINGPARAM( "vnd.sun.star.expand:" ) );
- static const OUString stheMacroExpander( RTL_CONSTASCII_USTRINGPARAM( "/singletons/com.sun.star.util.theMacroExpander" ) );
- Reference< container::XNameAccess > xSet( OpenConfiguration( true ), UNO_QUERY_THROW );
- if ( xSet->hasByName( TKGet( eToken ) ) )
- xSet->getByName( TKGet( eToken ) ) >>= aPath;
- if ( aPath.match( sProtocol, 0 ) )
- {
- rtl::OUString aTmp( aPath.copy( 20 ) );
- Reference< util::XMacroExpander > xExpander;
- if ( mxMSF->getValueByName( stheMacroExpander ) >>= xExpander )
- {
- aPath = xExpander->expandMacros( aTmp );
- }
- }
- }
- catch ( Exception& )
- {
- }
- return aPath;
-}
-
-rtl::OUString ConfigurationAccess::getString( const PPPOptimizerTokenEnum eToken ) const
+rtl::OUString ConfigurationAccess::getString( sal_Int32 nResId )
{
- std::map< PPPOptimizerTokenEnum, rtl::OUString, Compare >::const_iterator aIter( maStrings.find( eToken ) );
- return aIter != maStrings.end() ? ((*aIter).second) : rtl::OUString();
+ const StringResourceMap &aStrings = StaticResourceMap::get();
+ StringResourceMap::const_iterator aIter( aStrings.find( nResId ) );
+ return aIter != aStrings.end() ? ((*aIter).second) : rtl::OUString();
}
void ConfigurationAccess::LoadStrings()
{
+ static bool bLoaded = false;
+ if ( bLoaded )
+ return;
+ else
+ bLoaded = true;
try
{
- do
- {
- Reference< XInterface > xRoot( OpenConfiguration( true ) );
- if ( !xRoot.is() )
- break;
- Reference< container::XNameAccess > xSet( GetConfigurationNode( xRoot, TKGet( TK_Strings ) ), UNO_QUERY );
- if ( xSet.is() )
- {
- const Sequence< OUString > aElements( xSet->getElementNames() );
- for ( int i = 0; i < aElements.getLength(); i++ )
- {
- try
- {
- OUString aString, aPropertyName( aElements[ i ] );
- if ( xSet->getByName( aPropertyName ) >>= aString )
- maStrings[ TKGet( aPropertyName ) ] = aString;
- }
- catch( Exception& )
- {
- }
- }
- }
- }
- while( false );
+
+ Reference< resource::XResourceBundleLoader > xResourceBundleLoader(
+ m_xContext->getValueByName(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/com.sun.star.resource.OfficeResourceLoader" ) ) ),
+ UNO_QUERY_THROW );
+
+ Reference< resource::XResourceBundle > xResourceBundle(
+ xResourceBundleLoader->loadBundle_Default(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "minimizer" ) ) ),
+ UNO_SET_THROW );
+
+ StringResourceMap &aStrings = StaticResourceMap::get();
+ aStrings[ STR_PRESENTATION_MINIMIZER ] = lcl_loadString( xResourceBundle, STR_PRESENTATION_MINIMIZER );
+ aStrings[ STR_STEPS ] = lcl_loadString( xResourceBundle, STR_STEPS );
+ aStrings[ STR_HELP ] = lcl_loadString( xResourceBundle, STR_HELP );
+ aStrings[ STR_BACK ] = lcl_loadString( xResourceBundle, STR_BACK );
+ aStrings[ STR_NEXT ] = lcl_loadString( xResourceBundle, STR_NEXT );
+ aStrings[ STR_FINISH ] = lcl_loadString( xResourceBundle, STR_FINISH );
+ aStrings[ STR_CANCEL ] = lcl_loadString( xResourceBundle, STR_CANCEL );
+ aStrings[ STR_INTRODUCTION ] = lcl_loadString( xResourceBundle, STR_INTRODUCTION );
+ aStrings[ STR_INTRODUCTION_T ] = lcl_loadString( xResourceBundle, STR_INTRODUCTION_T );
+ aStrings[ STR_CHOSE_SETTINGS ] = lcl_loadString( xResourceBundle, STR_CHOSE_SETTINGS );
+ aStrings[ STR_REMOVE ] = lcl_loadString( xResourceBundle, STR_REMOVE );
+ aStrings[ STR_GRAPHIC_OPTIMIZATION ] = lcl_loadString( xResourceBundle, STR_GRAPHIC_OPTIMIZATION );
+ aStrings[ STR_IMAGE_OPTIMIZATION ] = lcl_loadString( xResourceBundle, STR_IMAGE_OPTIMIZATION );
+ aStrings[ STR_LOSSLESS_COMPRESSION ] = lcl_loadString( xResourceBundle, STR_LOSSLESS_COMPRESSION );
+ aStrings[ STR_JPEG_COMPRESSION ] = lcl_loadString( xResourceBundle, STR_JPEG_COMPRESSION );
+ aStrings[ STR_QUALITY ] = lcl_loadString( xResourceBundle, STR_QUALITY );
+ aStrings[ STR_REMOVE_CROP_AREA ] = lcl_loadString( xResourceBundle, STR_REMOVE_CROP_AREA );
+ aStrings[ STR_IMAGE_RESOLUTION ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION );
+ aStrings[ STR_IMAGE_RESOLUTION_0 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_0 );
+ aStrings[ STR_IMAGE_RESOLUTION_1 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_1 );
+ aStrings[ STR_IMAGE_RESOLUTION_2 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_2 );
+ aStrings[ STR_IMAGE_RESOLUTION_3 ] = lcl_loadString( xResourceBundle, STR_IMAGE_RESOLUTION_3 );
+ aStrings[ STR_EMBED_LINKED_GRAPHICS ] = lcl_loadString( xResourceBundle, STR_EMBED_LINKED_GRAPHICS );
+ aStrings[ STR_OLE_OBJECTS ] = lcl_loadString( xResourceBundle, STR_OLE_OBJECTS );
+ aStrings[ STR_OLE_OPTIMIZATION ] = lcl_loadString( xResourceBundle, STR_OLE_OPTIMIZATION );
+ aStrings[ STR_OLE_REPLACE ] = lcl_loadString( xResourceBundle, STR_OLE_REPLACE );
+ aStrings[ STR_ALL_OLE_OBJECTS ] = lcl_loadString( xResourceBundle, STR_ALL_OLE_OBJECTS );
+ aStrings[ STR_ALIEN_OLE_OBJECTS_ONLY ] = lcl_loadString( xResourceBundle, STR_ALIEN_OLE_OBJECTS_ONLY );
+ aStrings[ STR_OLE_OBJECTS_DESC ] = lcl_loadString( xResourceBundle, STR_OLE_OBJECTS_DESC );
+ aStrings[ STR_NO_OLE_OBJECTS_DESC ] = lcl_loadString( xResourceBundle, STR_NO_OLE_OBJECTS_DESC );
+ aStrings[ STR_SLIDES ] = lcl_loadString( xResourceBundle, STR_SLIDES );
+ aStrings[ STR_CHOOSE_SLIDES ] = lcl_loadString( xResourceBundle, STR_CHOOSE_SLIDES );
+ aStrings[ STR_MASTER_PAGES ] = lcl_loadString( xResourceBundle, STR_MASTER_PAGES );
+ aStrings[ STR_DELETE_MASTER_PAGES ] = lcl_loadString( xResourceBundle, STR_DELETE_MASTER_PAGES );
+ aStrings[ STR_DELETE_NOTES_PAGES ] = lcl_loadString( xResourceBundle, STR_DELETE_NOTES_PAGES );
+ aStrings[ STR_DELETE_HIDDEN_SLIDES ] = lcl_loadString( xResourceBundle, STR_DELETE_HIDDEN_SLIDES );
+ aStrings[ STR_CUSTOM_SHOW ] = lcl_loadString( xResourceBundle, STR_CUSTOM_SHOW );
+ aStrings[ STR_SUMMARY ] = lcl_loadString( xResourceBundle, STR_SUMMARY );
+ aStrings[ STR_SUMMARY_TITLE ] = lcl_loadString( xResourceBundle, STR_SUMMARY_TITLE );
+ aStrings[ STR_PROGRESS ] = lcl_loadString( xResourceBundle, STR_PROGRESS );
+ aStrings[ STR_OBJECTS_OPTIMIZED ] = lcl_loadString( xResourceBundle, STR_OBJECTS_OPTIMIZED );
+ aStrings[ STR_APPLY_TO_CURRENT ] = lcl_loadString( xResourceBundle, STR_APPLY_TO_CURRENT );
+ aStrings[ STR_AUTOMATICALLY_OPEN ] = lcl_loadString( xResourceBundle, STR_AUTOMATICALLY_OPEN );
+ aStrings[ STR_SAVE_SETTINGS ] = lcl_loadString( xResourceBundle, STR_SAVE_SETTINGS );
+ aStrings[ STR_SAVE_AS ] = lcl_loadString( xResourceBundle, STR_SAVE_AS );
+ aStrings[ STR_DELETE_SLIDES ] = lcl_loadString( xResourceBundle, STR_DELETE_SLIDES );
+ aStrings[ STR_OPTIMIZE_IMAGES ] = lcl_loadString( xResourceBundle, STR_OPTIMIZE_IMAGES );
+ aStrings[ STR_CREATE_REPLACEMENT ] = lcl_loadString( xResourceBundle, STR_CREATE_REPLACEMENT );
+ aStrings[ STR_CURRENT_FILESIZE ] = lcl_loadString( xResourceBundle, STR_CURRENT_FILESIZE );
+ aStrings[ STR_ESTIMATED_FILESIZE ] = lcl_loadString( xResourceBundle, STR_ESTIMATED_FILESIZE );
+ aStrings[ STR_MB ] = lcl_loadString( xResourceBundle, STR_MB );
+ aStrings[ STR_MY_SETTINGS ] = lcl_loadString( xResourceBundle, STR_MY_SETTINGS );
+ aStrings[ STR_DEFAULT_SESSION ] = lcl_loadString( xResourceBundle, STR_DEFAULT_SESSION );
+ aStrings[ STR_MODIFY_WARNING ] = lcl_loadString( xResourceBundle, STR_MODIFY_WARNING );
+ aStrings[ STR_YES ] = lcl_loadString( xResourceBundle, STR_YES );
+ aStrings[ STR_OK ] = lcl_loadString( xResourceBundle, STR_OK );
+ aStrings[ STR_INFO_1 ] = lcl_loadString( xResourceBundle, STR_INFO_1 );
+ aStrings[ STR_INFO_2 ] = lcl_loadString( xResourceBundle, STR_INFO_2 );
+ aStrings[ STR_INFO_3 ] = lcl_loadString( xResourceBundle, STR_INFO_3 );
+ aStrings[ STR_INFO_4 ] = lcl_loadString( xResourceBundle, STR_INFO_4 );
+ aStrings[ STR_DUPLICATING_PRESENTATION ] = lcl_loadString( xResourceBundle, STR_DUPLICATING_PRESENTATION );
+ aStrings[ STR_DELETING_SLIDES ] = lcl_loadString( xResourceBundle, STR_DELETING_SLIDES );
+ aStrings[ STR_OPTIMIZING_GRAPHICS ] = lcl_loadString( xResourceBundle, STR_OPTIMIZING_GRAPHICS );
+ aStrings[ STR_CREATING_OLE_REPLACEMENTS] = lcl_loadString( xResourceBundle, STR_CREATING_OLE_REPLACEMENTS );
+ aStrings[ STR_FILESIZESEPARATOR ] = lcl_loadString( xResourceBundle, STR_FILESIZESEPARATOR );
+ aStrings[ STR_INFO_DIALOG ] = lcl_loadString( xResourceBundle, STR_INFO_DIALOG );
}
catch( Exception& )
{
@@ -334,7 +416,7 @@ Reference< XInterface > ConfigurationAccess::OpenConfiguration( bool bReadOnly )
Reference< XInterface > xRoot;
try
{
- Reference< lang::XMultiServiceFactory > xProvider( mxMSF->getServiceManager()->createInstanceWithContext( GetConfigurationProviderServiceName(), mxMSF ), UNO_QUERY );
+ Reference< lang::XMultiServiceFactory > xProvider( m_xContext->getServiceManager()->createInstanceWithContext( GetConfigurationProviderServiceName(), m_xContext ), UNO_QUERY );
if ( xProvider.is() )
{
Sequence< Any > aCreationArguments( 2 );
diff --git a/sdext/source/minimizer/configurationaccess.hxx b/sdext/source/minimizer/configurationaccess.hxx
index 5ef805b828cd..73a0d45ea818 100644
--- a/sdext/source/minimizer/configurationaccess.hxx
+++ b/sdext/source/minimizer/configurationaccess.hxx
@@ -40,6 +40,7 @@
#include <com/sun/star/container/XNameReplace.hpp>
#include <map>
+
struct OptimizerSettings
{
rtl::OUString maName;
@@ -86,13 +87,12 @@ class ConfigurationAccess
{
public :
- ConfigurationAccess( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rXFactory,
+ ConfigurationAccess( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
OptimizerSettings* pDefaultSettings = NULL );
~ConfigurationAccess();
void SaveConfiguration();
- rtl::OUString getPath( const PPPOptimizerTokenEnum );
- rtl::OUString getString( const PPPOptimizerTokenEnum ) const;
+ static rtl::OUString getString( sal_Int32 nResId );
// access to current OptimizerSettings (stored in the first entry of maSettings)
com::sun::star::uno::Any GetConfigProperty( const PPPOptimizerTokenEnum ) const;
@@ -110,20 +110,10 @@ class ConfigurationAccess
private :
- struct Compare
- {
- bool operator()( const PPPOptimizerTokenEnum s1, const PPPOptimizerTokenEnum s2 ) const
- {
- return s1 < s2;
- }
- };
- std::map < PPPOptimizerTokenEnum, rtl::OUString, Compare > maStrings;
-
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
std::vector< OptimizerSettings > maSettings;
std::vector< OptimizerSettings > maInitialSettings;
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
-
void LoadStrings();
void LoadConfiguration();
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > OpenConfiguration( bool bReadOnly );
diff --git a/sdext/source/minimizer/delzip b/sdext/source/minimizer/delzip
deleted file mode 100644
index 8b137891791f..000000000000
--- a/sdext/source/minimizer/delzip
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/sdext/source/minimizer/description.xml b/sdext/source/minimizer/description.xml
deleted file mode 100644
index 05253a978154..000000000000
--- a/sdext/source/minimizer/description.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************
- *
- * 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
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- ***********************************************************-->
-<description
-
- xmlns="http://openoffice.org/extensions/description/2006"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:dep="http://openoffice.org/extensions/description/2006">
-
- <identifier value="UPDATED_IDENTIFIER"/>
-
- <dependencies>
- <OpenOffice.org-minimal-version value="4.0" dep:name="OpenOffice"/>
- <OpenOffice.org-maximal-version value="4.9" dep:name="OpenOffice"/>
- </dependencies>
-
- <registration>
- <simple-license accept-by="admin" default-license-id="lic-en-US" suppress-if-required="true" >
- <license-text xlink:href="licensefile" lang="isocode" license-id="lic-isocode"/>
- </simple-license>
- </registration>
-
- <version value="1.1.0"/>
-
- <platform value="UPDATED_SUPPORTED_PLATFORM"/>
-
- <publisher>
- <name xlink:href="http://www.openoffice.org" lang="en">Apache Software Foundation</name>
- </publisher>
-
- <display-name>
- <name lang="en-US">Presentation Minimizer</name>
- </display-name>
-
- <icon>
- <default xlink:href="bitmaps/extension_32.png" />
- <high-contrast xlink:href="bitmaps/extension_32_h.png" />
- </icon>
-
-</description>
diff --git a/sdext/source/minimizer/fileopendialog.cxx b/sdext/source/minimizer/fileopendialog.cxx
index f074640fc439..c80099fe6557 100644
--- a/sdext/source/minimizer/fileopendialog.cxx
+++ b/sdext/source/minimizer/fileopendialog.cxx
@@ -57,7 +57,6 @@
#include <rtl/ustrbuf.hxx>
-using namespace ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
@@ -65,14 +64,53 @@ using namespace ::com::sun::star::container;
using namespace ::com::sun::star::view;
using namespace ::com::sun::star::ui::dialogs;
-FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxMSF ) :
- mxMSF( rxMSF )
+using ::com::sun::star::awt::XWindow;
+using ::rtl::OUString;
+
+namespace
{
- Sequence< Any > aInitPropSeq( 1 );
- aInitPropSeq[ 0 ] <<= (sal_Int16)TemplateDescription::FILESAVE_AUTOEXTENSION; // TemplateDescription.FILEOPEN_SIMPLE
+ inline bool lcl_isSystemDialog(
+ const Reference< XInterface > &rxIfce )
+ {
+ Reference< XServiceInfo > xInfo( rxIfce, UNO_QUERY );
+ if ( !xInfo.is() )
+ return false;
+
+ return xInfo->supportsService(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ui.dialogs.SystemFilePicker" ) ) );
+ }
+}
+
+FileOpenDialog::FileOpenDialog(
+ const Reference< XComponentContext >& rxContext,
+ const Reference< XWindow > &rxParent )
+ : mxContext( rxContext )
+{
+ mxFilePicker = Reference < XFilePicker >(
+ mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.ui.dialogs.FilePicker" ) ),
+ rxContext ), UNO_QUERY_THROW );
+ Reference< XInitialization > xInit( mxFilePicker, UNO_QUERY_THROW );
+ bool bIsSystemDlg = lcl_isSystemDialog( mxFilePicker );
+ Sequence< Any > aInitPropSeq( bIsSystemDlg ? 1 : 2 );
+ if ( bIsSystemDlg )
+ {
+ aInitPropSeq[0] <<= TemplateDescription::FILESAVE_AUTOEXTENSION;
+ xInit->initialize( aInitPropSeq );
+ }
+ else
+ {
+ aInitPropSeq[ 0 ] <<= NamedValue(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("TemplateDescription")),
+ makeAny( (sal_Int16)TemplateDescription::FILESAVE_AUTOEXTENSION));
+ aInitPropSeq[ 1 ] <<= NamedValue(
+ OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow")),
+ makeAny( rxParent ));
+ xInit->initialize( aInitPropSeq );
+ }
- mxFilePicker = Reference < XFilePicker >( mxMSF->getServiceManager()->createInstanceWithArgumentsAndContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ) ), aInitPropSeq, rxMSF ),UNO_QUERY_THROW );
mxFilePicker->setMultiSelectionMode( sal_False );
Reference< XFilePickerControlAccess > xAccess( mxFilePicker, UNO_QUERY );
@@ -88,8 +126,8 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxMSF ) :
}
// collecting a list of impress filters
- Reference< XNameAccess > xFilters( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xFilters( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.FilterFactory" ) ), rxContext ), UNO_QUERY_THROW );
Sequence< OUString > aFilterList( xFilters->getElementNames() );
for ( int i = 0; i < aFilterList.getLength(); i++ )
{
@@ -133,14 +171,14 @@ FileOpenDialog::FileOpenDialog( const Reference< XComponentContext >& rxMSF ) :
}
}
- Reference< XNameAccess > xTypes( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ) ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XNameAccess > xTypes( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.document.TypeDetection" ) ), rxContext ), UNO_QUERY_THROW );
Sequence< OUString > aTypeList( xFilters->getElementNames() );
// mxFilePicker->setDefaultName( );
const char filter[] = "*.";
- // the filter title must be formed in the same it is currently done
+ // the filter title must be formed in the same way it is currently done
// in the internal implementation: "UIName (.<extension>)"
rtl::OUStringBuffer aUIName;
// the filter must be in the form "*.<extension>"
diff --git a/sdext/source/minimizer/fileopendialog.hxx b/sdext/source/minimizer/fileopendialog.hxx
index eadc94cc1976..1c50dcb6c894 100644
--- a/sdext/source/minimizer/fileopendialog.hxx
+++ b/sdext/source/minimizer/fileopendialog.hxx
@@ -30,6 +30,7 @@
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
class FileOpenDialog
{
@@ -46,13 +47,14 @@ class FileOpenDialog
FilterEntry() :
maFlags( 0 ) {}
};
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference < ::com::sun::star::ui::dialogs::XFilePicker > mxFilePicker;
std::vector< FilterEntry > aFilterEntryList;
public :
- FileOpenDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF );
+ FileOpenDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XWindow > &rxParent );
~FileOpenDialog();
sal_Int16 execute();
diff --git a/sdext/source/minimizer/graphiccollector.cxx b/sdext/source/minimizer/graphiccollector.cxx
index 4374cf2062c6..b7cab5777fdb 100644
--- a/sdext/source/minimizer/graphiccollector.cxx
+++ b/sdext/source/minimizer/graphiccollector.cxx
@@ -35,7 +35,6 @@
#include "impoptimizer.hxx"
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
@@ -45,6 +44,8 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::presentation;
+using ::rtl::OUString;
+
const DeviceInfo& GraphicCollector::GetDeviceInfo( const Reference< XComponentContext >& rxFact )
{
static DeviceInfo aDeviceInfo;
@@ -95,7 +96,7 @@ void ImpAddEntity( std::vector< GraphicCollector::GraphicEntity >& rGraphicEntit
}
}
-void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference< XShape >& rxShape, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
+void ImpAddGraphicEntity( const Reference< XComponentContext >& rxContext, Reference< XShape >& rxShape, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
{
Reference< XGraphic > xGraphic;
Reference< XPropertySet > xShapePropertySet( rxShape, UNO_QUERY_THROW );
@@ -114,7 +115,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference
// calculating the logical size, as if there were no cropping
if ( aGraphicCropLogic.Left || aGraphicCropLogic.Right || aGraphicCropLogic.Top || aGraphicCropLogic.Bottom )
{
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
if ( aSize100thMM.Width && aSize100thMM.Height )
{
awt::Size aCropSize( aSize100thMM.Width - ( aGraphicCropLogic.Left + aGraphicCropLogic.Right ),
@@ -133,7 +134,7 @@ void ImpAddGraphicEntity( const Reference< XComponentContext >& rxMSF, Reference
}
}
-void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const Reference< XPropertySet >& rxPropertySet, const awt::Size& rLogicalSize,
+void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxContext, const Reference< XPropertySet >& rxPropertySet, const awt::Size& rLogicalSize,
std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities, const GraphicSettings& rGraphicSettings, const Reference< XPropertySet >& rxPagePropertySet )
{
try
@@ -171,7 +172,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const
{
if ( !aSize.Width || !aSize.Height )
{
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
if ( aSize100thMM.Width && aSize100thMM.Height )
aLogicalSize = aSize100thMM;
}
@@ -205,7 +206,7 @@ void ImpAddFillBitmapEntity( const Reference< XComponentContext >& rxMSF, const
}
}
-void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxMSF, const Reference< XDrawPage >& rxDrawPage, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
+void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxContext, const Reference< XDrawPage >& rxDrawPage, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
{
try
{
@@ -216,14 +217,14 @@ void ImpCollectBackgroundGraphic( const Reference< XComponentContext >& rxMSF, c
Reference< XPropertySet > xBackgroundPropSet;
if ( xPropertySet->getPropertyValue( TKGet( TK_Background ) ) >>= xBackgroundPropSet )
- ImpAddFillBitmapEntity( rxMSF, xBackgroundPropSet, aLogicalSize, rGraphicEntities, rGraphicSettings, xPropertySet );
+ ImpAddFillBitmapEntity( rxContext, xBackgroundPropSet, aLogicalSize, rGraphicEntities, rGraphicSettings, xPropertySet );
}
catch( Exception& )
{
}
}
-void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
+void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxContext, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicEntities )
{
for ( sal_Int32 i = 0; i < rxShapes->getCount(); i++ )
{
@@ -236,18 +237,18 @@ void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, cons
if ( sShapeType == sGroupShape )
{
Reference< XShapes > xShapes( xShape, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xShapes, rGraphicSettings, rGraphicEntities );
+ ImpCollectGraphicObjects( rxContext, xShapes, rGraphicSettings, rGraphicEntities );
continue;
}
if ( sShapeType == sGraphicObjectShape )
- ImpAddGraphicEntity( rxMSF, xShape, rGraphicSettings, rGraphicEntities );
+ ImpAddGraphicEntity( rxContext, xShape, rGraphicSettings, rGraphicEntities );
// now check for a fillstyle
Reference< XPropertySet > xEmptyPagePropSet;
Reference< XPropertySet > xShapePropertySet( xShape, UNO_QUERY_THROW );
awt::Size aLogicalSize( xShape->getSize() );
- ImpAddFillBitmapEntity( rxMSF, xShapePropertySet, aLogicalSize, rGraphicEntities, rGraphicSettings, xEmptyPagePropSet );
+ ImpAddFillBitmapEntity( rxContext, xShapePropertySet, aLogicalSize, rGraphicEntities, rGraphicSettings, xEmptyPagePropSet );
}
catch( Exception& )
{
@@ -255,7 +256,7 @@ void ImpCollectGraphicObjects( const Reference< XComponentContext >& rxMSF, cons
}
}
-awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext >& rxMSF, const Reference< XGraphic >& rxGraphic )
+awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext >& rxContext, const Reference< XGraphic >& rxGraphic )
{
awt::Size aSize100thMM( 0, 0 );
Reference< XPropertySet > xGraphicPropertySet( rxGraphic, UNO_QUERY_THROW );
@@ -266,7 +267,7 @@ awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext
awt::Size aSourceSizePixel( 0, 0 );
if ( xGraphicPropertySet->getPropertyValue( TKGet( TK_SizePixel ) ) >>= aSourceSizePixel )
{
- const DeviceInfo& rDeviceInfo( GraphicCollector::GetDeviceInfo( rxMSF ) );
+ const DeviceInfo& rDeviceInfo( GraphicCollector::GetDeviceInfo( rxContext ) );
if ( rDeviceInfo.PixelPerMeterX && rDeviceInfo.PixelPerMeterY )
{
aSize100thMM.Width = static_cast< sal_Int32 >( ( aSourceSizePixel.Width * 100000.0 ) / rDeviceInfo.PixelPerMeterX );
@@ -278,7 +279,7 @@ awt::Size GraphicCollector::GetOriginalSize( const Reference< XComponentContext
return aSize100thMM;
}
-void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rxMSF, const Reference< XModel >& rxModel,
+void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxModel,
const GraphicSettings& rGraphicSettings, std::vector< GraphicCollector::GraphicEntity >& rGraphicList )
{
try
@@ -289,24 +290,24 @@ void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rx
for ( i = 0; i < xDrawPages->getCount(); i++ )
{
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCollectBackgroundGraphic( rxMSF, xDrawPage, rGraphicSettings, rGraphicList );
+ ImpCollectBackgroundGraphic( rxContext, xDrawPage, rGraphicSettings, rGraphicList );
Reference< XShapes > xDrawShapes( xDrawPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xDrawShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxContext, xDrawShapes, rGraphicSettings, rGraphicList );
Reference< XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
- ImpCollectBackgroundGraphic( rxMSF, xNotesPage, rGraphicSettings, rGraphicList );
+ ImpCollectBackgroundGraphic( rxContext, xNotesPage, rGraphicSettings, rGraphicList );
Reference< XShapes > xNotesShapes( xNotesPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xNotesShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxContext, xNotesShapes, rGraphicSettings, rGraphicList );
}
Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
for ( i = 0; i < xMasterPages->getCount(); i++ )
{
Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCollectBackgroundGraphic( rxMSF, xMasterPage, rGraphicSettings, rGraphicList );
+ ImpCollectBackgroundGraphic( rxContext, xMasterPage, rGraphicSettings, rGraphicList );
Reference< XShapes > xMasterPageShapes( xMasterPage, UNO_QUERY_THROW );
- ImpCollectGraphicObjects( rxMSF, xMasterPageShapes, rGraphicSettings, rGraphicList );
+ ImpCollectGraphicObjects( rxContext, xMasterPageShapes, rGraphicSettings, rGraphicList );
}
std::vector< GraphicCollector::GraphicEntity >::iterator aGraphicIter( rGraphicList.begin() );
@@ -348,7 +349,7 @@ void GraphicCollector::CollectGraphics( const Reference< XComponentContext >& rx
}
}
-void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics )
+void ImpCountGraphicObjects( const Reference< XComponentContext >& rxContext, const Reference< XShapes >& rxShapes, const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics )
{
for ( sal_Int32 i = 0; i < rxShapes->getCount(); i++ )
{
@@ -361,7 +362,7 @@ void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const
if ( sShapeType == sGroupShape )
{
Reference< XShapes > xShapes( xShape, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xShapes, rGraphicSettings, rnGraphics );
continue;
}
@@ -390,7 +391,7 @@ void ImpCountGraphicObjects( const Reference< XComponentContext >& rxMSF, const
}
}
-void ImpCountBackgroundGraphic( const Reference< XComponentContext >& /* rxMSF */, const Reference< XDrawPage >& rxDrawPage,
+void ImpCountBackgroundGraphic( const Reference< XComponentContext >& /* rxContext */, const Reference< XDrawPage >& rxDrawPage,
const GraphicSettings& /* rGraphicSettings */, sal_Int32& rnGraphics )
{
try
@@ -418,7 +419,7 @@ void ImpCountBackgroundGraphic( const Reference< XComponentContext >& /* rxMSF *
}
}
-void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxMSF, const Reference< XModel >& rxModel,
+void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxModel,
const GraphicSettings& rGraphicSettings, sal_Int32& rnGraphics )
{
try
@@ -429,24 +430,24 @@ void GraphicCollector::CountGraphics( const Reference< XComponentContext >& rxMS
for ( i = 0; i < xDrawPages->getCount(); i++ )
{
Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCountBackgroundGraphic( rxMSF, xDrawPage, rGraphicSettings, rnGraphics );
+ ImpCountBackgroundGraphic( rxContext, xDrawPage, rGraphicSettings, rnGraphics );
Reference< XShapes > xDrawShapes( xDrawPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xDrawShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xDrawShapes, rGraphicSettings, rnGraphics );
Reference< XPresentationPage > xPresentationPage( xDrawPage, UNO_QUERY_THROW );
Reference< XDrawPage > xNotesPage( xPresentationPage->getNotesPage() );
- ImpCountBackgroundGraphic( rxMSF, xNotesPage, rGraphicSettings, rnGraphics );
+ ImpCountBackgroundGraphic( rxContext, xNotesPage, rGraphicSettings, rnGraphics );
Reference< XShapes > xNotesShapes( xNotesPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xNotesShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xNotesShapes, rGraphicSettings, rnGraphics );
}
Reference< XMasterPagesSupplier > xMasterPagesSupplier( rxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
for ( i = 0; i < xMasterPages->getCount(); i++ )
{
Reference< XDrawPage > xMasterPage( xMasterPages->getByIndex( i ), UNO_QUERY_THROW );
- ImpCountBackgroundGraphic( rxMSF, xMasterPage, rGraphicSettings, rnGraphics );
+ ImpCountBackgroundGraphic( rxContext, xMasterPage, rGraphicSettings, rnGraphics );
Reference< XShapes > xMasterPageShapes( xMasterPage, UNO_QUERY_THROW );
- ImpCountGraphicObjects( rxMSF, xMasterPageShapes, rGraphicSettings, rnGraphics );
+ ImpCountGraphicObjects( rxContext, xMasterPageShapes, rGraphicSettings, rnGraphics );
}
}
catch ( Exception& )
diff --git a/sdext/source/minimizer/graphiccollector.hxx b/sdext/source/minimizer/graphiccollector.hxx
index 5314c7c7b282..05be456a6980 100644
--- a/sdext/source/minimizer/graphiccollector.hxx
+++ b/sdext/source/minimizer/graphiccollector.hxx
@@ -82,14 +82,14 @@ class GraphicCollector
};
static const com::sun::star::awt::DeviceInfo& GetDeviceInfo( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxFact );
- static com::sun::star::awt::Size GetOriginalSize( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF,
+ static com::sun::star::awt::Size GetOriginalSize( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
const com::sun::star::uno::Reference< com::sun::star::graphic::XGraphic >& rxGraphic );
// collecting graphic instances, the downside of this method is that every graphic is swapped in
- static void CollectGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
+ static void CollectGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
const GraphicSettings& rGraphicSettings, std::vector< GraphicEntity >& io_rGraphicList );
// counting graphics without swapping in graphics
- static void CountGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
+ static void CountGraphics( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext, const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel,
const GraphicSettings& rGraphicSettings, sal_Int32& rGraphics );
};
diff --git a/sdext/source/minimizer/help/component.txt b/sdext/source/minimizer/help/component.txt
deleted file mode 100644
index 98f2687800ff..000000000000
--- a/sdext/source/minimizer/help/component.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed, and data that is no longer needed will be removed.
-The Presentation Minimizer can optimize the image quality size. Presentations designed for screen or projector do not require the same high quality as presentations designed for print.
diff --git a/sdext/source/minimizer/help/help_de.odt b/sdext/source/minimizer/help/help_de.odt
deleted file mode 100644
index bb9bc0395c0f..000000000000
--- a/sdext/source/minimizer/help/help_de.odt
+++ /dev/null
Binary files differ
diff --git a/sdext/source/minimizer/help/help_en-US.odt b/sdext/source/minimizer/help/help_en-US.odt
deleted file mode 100644
index bb9bc0395c0f..000000000000
--- a/sdext/source/minimizer/help/help_en-US.odt
+++ /dev/null
Binary files differ
diff --git a/sdext/source/minimizer/helpid.hrc b/sdext/source/minimizer/helpid.hrc
new file mode 100644
index 000000000000..f8b9b00d6555
--- /dev/null
+++ b/sdext/source/minimizer/helpid.hrc
@@ -0,0 +1,57 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#define HID( helpid ) ( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( helpid ) ) )
+
+#define HID_SDEXT_MINIMIZER_WIZ_DLG "sdext:Minimizer:Wizard:Dialog"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP1 "sdext:Minimizer:Wizard:Step1"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP1_LB_SETTINGS "sdext:Minimizer:Wizard:Step1:LBSettings"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP1_PB_DELSETTS "sdext:Minimizer:Wizard:Step1:PBDelSetts"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2 "sdext:Minimizer:Wizard:Step2"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_CUSTOMSHOW "sdext:Minimizer:Wizard:Step2:CBCustomShow"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_HIDDENSLIDES "sdext:Minimizer:Wizard:Step2:CBHiddenSlides"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_MASTERPAGES "sdext:Minimizer:Wizard:Step2:CBMasterPages"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_NOTES "sdext:Minimizer:Wizard:Step2:CBNotes"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP2_LB_CUSTOMSHOW "sdext:Minimizer:Wizard:Step2:LBCustomShow"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3 "sdext:Minimizer:Wizard:Step3"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_CROP "sdext:Minimizer:Wizard:Step3:CBCrop"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_LB_DPI "sdext:Minimizer:Wizard:Step3:LBDPI" // TODO change in help
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_LINKS "sdext:Minimizer:Wizard:Step3:CBLinks"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_MF_QUALITY "sdext:Minimizer:Wizard:Step3:MFQuality"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_JPEG "sdext:Minimizer:Wizard:Step3:RBJPEG"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_LOSSLESS "sdext:Minimizer:Wizard:Step3:RBLossless"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4 "sdext:Minimizer:Wizard:Step4"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4_CB_OLE "sdext:Minimizer:Wizard:Step4:CBOLE"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_ALLOLE "sdext:Minimizer:Wizard:Step4:RBAllOLE"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_NOTODF "sdext:Minimizer:Wizard:Step4:RBNotODF"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5 "sdext:Minimizer:Wizard:Step5"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_CURDOC "sdext:Minimizer:Wizard:Step5:RBCurDoc"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_NEWDOC "sdext:Minimizer:Wizard:Step5:RBNewDoc"
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_CB_SAVESETTINGS "sdext:Minimizer:Wizard:Step5:CBSaveSetts" // TODO ADD to help
+#define HID_SDEXT_MINIMIZER_WIZ_STEP5_LB_SETTINGSNAME "sdext:Minimizer:Wizard:Step5:LBSettsName" // TODO ADD to help
+#define HID_SDEXT_MINIMIZER_WIZ_PB_HELP "sdext:Minimizer:Wizard:PBHelp" // TODO ADD to help
+#define HID_SDEXT_MINIMIZER_WIZ_PB_BACK "sdext:Minimizer:Wizard:PBBack"
+#define HID_SDEXT_MINIMIZER_WIZ_PB_NEXT "sdext:Minimizer:Wizard:PBNext"
+#define HID_SDEXT_MINIMIZER_WIZ_PB_FINISH "sdext:Minimizer:Wizard:PBFinish"
+#define HID_SDEXT_MINIMIZER_WIZ_PB_CANCEL "sdext:Minimizer:Wizard:PBCancel"
+#define HID_SDEXT_MINIMIZER_INFOBOX_DLG "sdext:Minimizer:InfoBox:Dialog"
+#define HID_SDEXT_MINIMIZER_INFOBOX_CB_OPENNEW "sdext:Minimizer:InfoBox:CBOpenNew"
+
diff --git a/sdext/source/minimizer/impoptimizer.cxx b/sdext/source/minimizer/impoptimizer.cxx
index 1e43242fe5ff..feabd716418b 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -30,8 +30,8 @@
#include "pagecollector.hxx"
#include "informationdialog.hxx"
-#include <unotools/localfilehelper.hxx>
-#include <unotools/processfactory.hxx>
+#include "minimizer.hrc"
+
#include <vector>
#include "com/sun/star/util/URL.hpp"
#include "com/sun/star/util/XURLTransformer.hpp"
@@ -43,12 +43,9 @@
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/frame/XStorable.hpp>
-#ifndef _COM_SUN_STAR_FRAME_FrameSearchFlag_HPP_
#include <com/sun/star/frame/FrameSearchFlag.hpp>
-#endif
#include <com/sun/star/frame/XDispatchProvider.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <unotools/configmgr.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
@@ -61,9 +58,7 @@
#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/document/XFilter.hpp>
#include <com/sun/star/document/XExporter.hpp>
-#ifndef _COM_SUN_STAR_UNO_RUNTIME_EXCEPTION_HPP_
#include <com/sun/star/uno/RuntimeException.hpp>
-#endif
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/graphic/GraphicType.hpp>
@@ -73,7 +68,6 @@
#include <com/sun/star/util/URL.hpp>
using namespace ::std;
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::awt;
@@ -88,6 +82,8 @@ using namespace ::com::sun::star::document;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::presentation;
+using ::rtl::OUString;
+
void ImpExtractCustomShow( const Reference< XModel >& rxModel, const OUString& rCustomShowName )
{
vector< Reference< XDrawPage > > vNonUsedPageList;
@@ -266,7 +262,7 @@ void ImpCompressGraphic( Reference< XGraphicProvider >& rxGraphicProvider, const
}
}
-Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rxMSF,
+Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >& rxContext,
const Reference< XGraphic >& xGraphic, const awt::Size& aLogicalSize, const text::GraphicCrop& aGraphicCropLogic,
const GraphicSettings& rGraphicSettings )
{
@@ -301,7 +297,7 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >&
// cropping has to be removed from SourceSizePixel
if ( aGraphicCropLogic.Left || aGraphicCropLogic.Top || aGraphicCropLogic.Right || aGraphicCropLogic.Bottom )
{
- const awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
+ const awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
if ( bRemoveCropArea )
bNeedsOptimizing = sal_True;
@@ -350,9 +346,9 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >&
}
if ( bNeedsOptimizing && aDestSizePixel.Width && aDestSizePixel.Height )
{
- Reference< XStream > xTempFile( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxContext ), UNO_QUERY_THROW );
Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() );
- Reference< XGraphicProvider > xGraphicProvider( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XGraphicProvider > xGraphicProvider( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxContext ), UNO_QUERY_THROW );
ImpCompressGraphic( xGraphicProvider, xGraphic, xOutputStream, aDestMimeType, aLogicalSize, rGraphicSettings.mnJPEGQuality, rGraphicSettings.mnImageResolution, bRemoveCropArea, aGraphicCropLogic );
Reference< XInputStream > xInputStream( xTempFile->getInputStream() );
@@ -370,9 +366,9 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >&
else // this is a metafile
{
rtl::OUString aDestMimeType( aSourceMimeType );
- Reference< XStream > xTempFile( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XStream > xTempFile( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.io.TempFile" ), rxContext ), UNO_QUERY_THROW );
Reference< XOutputStream > xOutputStream( xTempFile->getOutputStream() );
- Reference< XGraphicProvider > xGraphicProvider( rxMSF->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxMSF ), UNO_QUERY_THROW );
+ Reference< XGraphicProvider > xGraphicProvider( rxContext->getServiceManager()->createInstanceWithContext( OUString::createFromAscii( "com.sun.star.graphic.GraphicProvider" ), rxContext ), UNO_QUERY_THROW );
ImpCompressGraphic( xGraphicProvider, xGraphic, xOutputStream, aDestMimeType, aLogicalSize, rGraphicSettings.mnJPEGQuality, rGraphicSettings.mnImageResolution, sal_False, aGraphicCropLogic );
Reference< XInputStream > xInputStream( xTempFile->getInputStream() );
Reference< XSeekable > xSeekable( xInputStream, UNO_QUERY_THROW );
@@ -390,7 +386,7 @@ Reference< XGraphic > ImpCompressGraphic( const Reference< XComponentContext >&
return xNewGraphic;
}
-void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentContext >& rxMSF, const GraphicSettings& rGraphicSettings,
+void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentContext >& rxContext, const GraphicSettings& rGraphicSettings,
std::vector< GraphicCollector::GraphicEntity >& rGraphicList )
{
try
@@ -425,8 +421,8 @@ void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentCont
if ( xGraphic.is() )
{
Reference< XPropertySet > xNewGraphicPropertySet( xGraphic, UNO_QUERY_THROW );
- awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxMSF, xGraphic ) );
- Reference< XGraphic > xNewGraphic( ImpCompressGraphic( rxMSF, xGraphic, aGraphicIter->maLogicalSize, aGraphicIter->maGraphicCropLogic, aGraphicSettings ) );
+ awt::Size aSize100thMM( GraphicCollector::GetOriginalSize( rxContext, xGraphic ) );
+ Reference< XGraphic > xNewGraphic( ImpCompressGraphic( rxContext, xGraphic, aGraphicIter->maLogicalSize, aGraphicIter->maGraphicCropLogic, aGraphicSettings ) );
if ( xNewGraphic.is() )
{
// applying graphic to each user
@@ -446,7 +442,7 @@ void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentCont
text::GraphicCrop aGraphicCropLogic( 0, 0, 0, 0 );
if ( !aGraphicSettings.mbRemoveCropArea )
{
- awt::Size aNewSize( GraphicCollector::GetOriginalSize( rxMSF, xNewGraphic ) );
+ awt::Size aNewSize( GraphicCollector::GetOriginalSize( rxContext, xNewGraphic ) );
aGraphicCropLogic.Left = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Left * ((double)aNewSize.Width / (double)aSize100thMM.Width));
aGraphicCropLogic.Top = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Top * ((double)aNewSize.Height / (double)aSize100thMM.Height));
aGraphicCropLogic.Right = (sal_Int32)((double)aGraphicUserIter->maGraphicCropLogic.Right * ((double)aNewSize.Width / (double)aSize100thMM.Width));
@@ -497,8 +493,8 @@ void CompressGraphics( ImpOptimizer& rOptimizer, const Reference< XComponentCont
// - ImpOptimizer -
// ----------------
-ImpOptimizer::ImpOptimizer( const Reference< XComponentContext >& rxMSF, const Reference< XModel >& rxModel ) :
- mxMSF ( rxMSF ),
+ImpOptimizer::ImpOptimizer( const Reference< XComponentContext >& rxContext, const Reference< XModel >& rxModel ) :
+ mxContext ( rxContext ),
mxModel ( rxModel ),
mbJPEGCompression ( sal_False ),
mnJPEGQuality ( 90 ),
@@ -512,30 +508,35 @@ ImpOptimizer::ImpOptimizer( const Reference< XComponentContext >& rxMSF, const R
mbDeleteNotesPages ( sal_False ),
mbOpenNewDocument ( sal_True )
{
+ OSL_TRACE("ImpOptimizer::ImpOptimizer");
+ Reference< XController > xController( mxModel->getCurrentController() );
+ if (xController.is() )
+ mxFrame.set( xController->getFrame() );
}
// -----------------------------------------------------------------------------
ImpOptimizer::~ImpOptimizer()
{
+ OSL_TRACE("ImpOptimizer::~ImpOptimizer");
}
// -----------------------------------------------------------------------------
void ImpOptimizer::DispatchStatus()
{
- if ( mxStatusDispatcher.is() )
+ if ( mxStatusListener.is() )
{
- URL aURL;
- aURL.Protocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) );
- aURL.Path = OUString( RTL_CONSTASCII_USTRINGPARAM( "statusupdate" ) );
- mxStatusDispatcher->dispatch( aURL, GetStatusSequence() );
+ FeatureStateEvent aState;
+ aState.IsEnabled = sal_True;
+ aState.State <<= GetStatusSequence();
+ mxStatusListener->statusChanged( aState );
}
}
// -----------------------------------------------------------------------------
-sal_Bool ImpOptimizer::Optimize()
+sal_Bool ImpOptimizer::ImplOptimize()
{
if ( maCustomShowName.getLength() )
@@ -544,7 +545,7 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbDeleteUnusedMasterPages )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DELETING_SLIDES ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DELETING_SLIDES ) ) );
DispatchStatus();
ImpDeleteUnusedMasterPages( mxModel );
}
@@ -552,14 +553,14 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbDeleteHiddenSlides )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 40 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DELETING_SLIDES ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DELETING_SLIDES ) ) );
DispatchStatus();
ImpDeleteHiddenSlides( mxModel );
}
if ( mbDeleteNotesPages )
{
- SetStatusValue( TK_Status, Any( TKGet( STR_DELETING_SLIDES ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DELETING_SLIDES ) ) );
DispatchStatus();
ImpDeleteNotesPages( mxModel );
}
@@ -567,7 +568,7 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbOLEOptimization )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 45 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_CREATING_OLE_REPLACEMENTS ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_CREATING_OLE_REPLACEMENTS ) ) );
DispatchStatus();
ImpConvertOLE( mxModel, mnOLEOptimizationType );
}
@@ -575,13 +576,13 @@ sal_Bool ImpOptimizer::Optimize()
if ( mbJPEGCompression || mbRemoveCropArea || mnImageResolution )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 50 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_OPTIMIZING_GRAPHICS ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_OPTIMIZING_GRAPHICS ) ) );
DispatchStatus();
std::vector< GraphicCollector::GraphicEntity > aGraphicList;
GraphicSettings aGraphicSettings( mbJPEGCompression, mnJPEGQuality, mbRemoveCropArea, mnImageResolution, mbEmbedLinkedGraphics );
- GraphicCollector::CollectGraphics( mxMSF, mxModel, aGraphicSettings, aGraphicList );
- CompressGraphics( *this, mxMSF, aGraphicSettings, aGraphicList );
+ GraphicCollector::CollectGraphics( mxContext, mxModel, aGraphicSettings, aGraphicList );
+ CompressGraphics( *this, mxContext, aGraphicSettings, aGraphicList );
}
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 100 ) ) );
DispatchStatus();
@@ -612,10 +613,12 @@ static void DispatchURL( Reference< XComponentContext > xMSF, OUString sURL, Ref
sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
{
+ OSL_TRACE("ImpOptimizer::Optimize");
sal_Bool bRet = sal_True;
if ( mxModel.is() )
{
+ Reference< XWindowPeer > xParentWindow;
sal_Int64 nEstimatedFileSize = 0;
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 0 ) ) );
DispatchStatus();
@@ -625,8 +628,8 @@ sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
{
switch( TKGet( rArguments[ i ].Name ) )
{
- case TK_StatusDispatcher : rArguments[ i ].Value >>= mxStatusDispatcher; break;
- case TK_InformationDialog: rArguments[ i ].Value >>= mxInformationDialog; break;
+ case TK_StatusListener : rArguments[ i ].Value >>= mxStatusListener; break;
+ case TK_ParentWindow: rArguments[ i ].Value >>= xParentWindow; break;
case TK_Settings :
{
com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > aSettings;
@@ -668,7 +671,7 @@ sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
{
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 10 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DUPLICATING_PRESENTATION ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DUPLICATING_PRESENTATION ) ) );
DispatchStatus();
Reference< XStorable >xStorable( mxModel, UNO_QUERY );
@@ -690,11 +693,11 @@ sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
nSourceSize = PPPOptimizer::GetFileSize( maSaveAsURL );
SetStatusValue( TK_Progress, Any( static_cast< sal_Int32 >( 30 ) ) );
- SetStatusValue( TK_Status, Any( TKGet( STR_DUPLICATING_PRESENTATION ) ) );
+ SetStatusValue( TK_Status, Any( ConfigurationAccess::getString( STR_DUPLICATING_PRESENTATION ) ) );
DispatchStatus();
- Reference< XDesktop > xDesktop( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), mxMSF ), UNO_QUERY );
+ Reference< XDesktop > xDesktop( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.Desktop" ) ), mxContext ), UNO_QUERY );
Reference< XFrame > xFrame( xDesktop, UNO_QUERY );
xSelf = xFrame->findFrame( TKGet( TK__blank ), FrameSearchFlag::CREATE );
Reference< XComponentLoader > xComponentLoader( xSelf, UNO_QUERY );
@@ -712,15 +715,15 @@ sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
if ( xStorable.is() && !xStorable->isReadonly() )
{
mxModel->lockControllers();
- bRet = Optimize();
+ bRet = ImplOptimize();
mxModel->unlockControllers();
// clearing undo stack:
- Reference< XFrame > xFrame( xSelf.is() ? xSelf : mxInformationDialog );
+ Reference< XFrame > xFrame( mxFrame );
if ( xFrame.is() )
{
const OUString sSlot( RTL_CONSTASCII_USTRINGPARAM( "slot:27115" ) );
- DispatchURL( mxMSF, sSlot, xFrame );
+ DispatchURL( mxContext, sSlot, xFrame );
}
}
@@ -733,9 +736,11 @@ sal_Bool ImpOptimizer::Optimize( const Sequence< PropertyValue >& rArguments )
}
}
- if ( mxInformationDialog.is() )
+ if ( xParentWindow.is() )
{
- InformationDialog aInformationDialog( mxMSF, mxInformationDialog, maSaveAsURL, mbOpenNewDocument, nSourceSize, nDestSize, nEstimatedFileSize );
+ InformationDialog aInformationDialog(
+ mxContext, xParentWindow, maSaveAsURL, mbOpenNewDocument,
+ nSourceSize, nDestSize, nEstimatedFileSize );
aInformationDialog.execute();
SetStatusValue( TK_OpenNewDocument, Any( mbOpenNewDocument ) );
DispatchStatus();
diff --git a/sdext/source/minimizer/impoptimizer.hxx b/sdext/source/minimizer/impoptimizer.hxx
index b2606f16549a..97e3152d02c0 100644
--- a/sdext/source/minimizer/impoptimizer.hxx
+++ b/sdext/source/minimizer/impoptimizer.hxx
@@ -35,6 +35,7 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#endif
#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
class Point;
class Size;
@@ -47,9 +48,9 @@ class ImpOptimizer : public OptimizationStats
{
private:
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
- com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > mxStatusDispatcher;
+ com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener > mxStatusListener;
sal_Bool mbJPEGCompression;
sal_Int32 mnJPEGQuality;
@@ -66,9 +67,9 @@ private:
rtl::OUString maFilterName;
sal_Bool mbOpenNewDocument;
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxInformationDialog;
+ com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
- sal_Bool Optimize();
+ sal_Bool ImplOptimize();
public:
diff --git a/sdext/source/minimizer/informationdialog.cxx b/sdext/source/minimizer/informationdialog.cxx
index 7074adf1e4d6..6a60a51caa1b 100644
--- a/sdext/source/minimizer/informationdialog.cxx
+++ b/sdext/source/minimizer/informationdialog.cxx
@@ -26,12 +26,19 @@
#include "informationdialog.hxx"
#include "optimizationstats.hxx"
+#include "minimizer.hrc"
+#include "helpid.hrc"
+
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <com/sun/star/awt/XUnitConversion.hpp>
#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
+#include <com/sun/star/graphic/GraphicType.hpp>
#include <rtl/ustrbuf.hxx>
#include "com/sun/star/util/URL.hpp"
#include "com/sun/star/util/XURLTransformer.hpp"
+#include <com/sun/star/util/MeasureUnit.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
#define DIALOG_WIDTH 240
#define DIALOG_HEIGHT 80
@@ -43,7 +50,6 @@
// - INFORMATIONDIALOG -
// ---------------------
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::io;
using namespace ::com::sun::star::ui;
@@ -56,12 +62,19 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::container;
-
+using ::rtl::OUString;
// -----------------------------------------------------------------------------
-rtl::OUString InsertFixedText( InformationDialog& rInformationDialog, const rtl::OUString& rControlName, const OUString& rLabel,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Int16 nTabIndex )
+Reference< XFixedText > InformationDialog::InsertFixedText(
+ const rtl::OUString& rControlName,
+ const OUString& rLabel,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bMultiLine,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_Height ),
@@ -88,12 +101,10 @@ rtl::OUString InsertFixedText( InformationDialog& rInformationDialog, const rtl:
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- rInformationDialog.insertFixedText( rControlName, aNames, aValues );
- return rControlName;
+ return insertFixedText( rControlName, aNames, aValues );
}
-rtl::OUString InsertImage(
- InformationDialog& rInformationDialog,
+Reference< XControl > InformationDialog::InsertImage(
const OUString& rControlName,
const OUString& rURL,
sal_Int32 nPosX,
@@ -124,17 +135,23 @@ rtl::OUString InsertImage(
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- rInformationDialog.insertImage( rControlName, aNames, aValues );
- return rControlName;
+ return insertImage( rControlName, aNames, aValues );
}
-rtl::OUString InsertCheckBox( InformationDialog& rInformationDialog, const OUString& rControlName,
- const Reference< XItemListener > xItemListener, const OUString& rLabel,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex )
+Reference< XCheckBox > InformationDialog::InsertCheckBox(
+ const OUString& rControlName,
+ const OUString& rLabel,
+ const OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_Enabled ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -145,6 +162,7 @@ rtl::OUString InsertCheckBox( InformationDialog& rInformationDialog, const OUStr
Any pValues[] = {
Any( sal_True ),
Any( nHeight ),
+ Any( rHelpURL ),
Any( rLabel ),
Any( nXPos ),
Any( nYPos ),
@@ -157,14 +175,17 @@ rtl::OUString InsertCheckBox( InformationDialog& rInformationDialog, const OUStr
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XCheckBox > xCheckBox( rInformationDialog.insertCheckBox( rControlName, aNames, aValues ) );
- if ( xItemListener.is() )
- xCheckBox->addItemListener( xItemListener );
- return rControlName;
+ return insertCheckBox( rControlName, aNames, aValues );
}
-rtl::OUString InsertButton( InformationDialog& rInformationDialog, const OUString& rControlName, Reference< XActionListener >& xActionListener,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex, PPPOptimizerTokenEnum nResID )
+Reference< XButton > InformationDialog::InsertButton(
+ const OUString& rControlName,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex,
+ sal_Int32 nResID )
{
OUString pNames[] = {
TKGet( TK_Enabled ),
@@ -180,7 +201,7 @@ rtl::OUString InsertButton( InformationDialog& rInformationDialog, const OUStrin
Any pValues[] = {
Any( sal_True ),
Any( nHeight ),
- Any( rInformationDialog.getString( nResID ) ),
+ Any( getString( nResID ) ),
Any( nXPos ),
Any( nYPos ),
Any( static_cast< sal_Int16 >( PushButtonType_OK ) ),
@@ -194,8 +215,7 @@ rtl::OUString InsertButton( InformationDialog& rInformationDialog, const OUStrin
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- rInformationDialog.insertButton( rControlName, xActionListener, aNames, aValues );
- return rControlName;
+ return insertButton( rControlName, Reference< XActionListener >(), aNames, aValues );
}
@@ -221,6 +241,7 @@ void InformationDialog::InitDialog()
OUString pNames[] = {
TKGet( TK_Closeable ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_Moveable ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -230,10 +251,11 @@ void InformationDialog::InitDialog()
Any pValues[] = {
Any( sal_True ),
Any( nDialogHeight ),
+ Any( HID( HID_SDEXT_MINIMIZER_INFOBOX_DLG ) ),
Any( sal_True ),
Any( sal_Int32( 245 ) ),
Any( sal_Int32( 115 ) ),
- Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ),
+ Any( getString( STR_INFO_DIALOG ) ),
Any( sal_Int32( DIALOG_WIDTH ) ) };
sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString );
@@ -246,30 +268,30 @@ void InformationDialog::InitDialog()
sal_Int64 nSource = mnSourceSize;
sal_Int64 nDest = mnDestSize;
- PPPOptimizerTokenEnum eInfoString( STR_INFO_1 );
+ sal_Int32 nInfoStrResId( STR_INFO_1 );
if ( mnSourceSize )
{
if ( mnDestSize )
- eInfoString = STR_INFO_1;
+ nInfoStrResId = STR_INFO_1;
else
{
- eInfoString = STR_INFO_2;
+ nInfoStrResId = STR_INFO_2;
nDest = mnApproxSize;
}
}
else if ( mnDestSize )
- eInfoString = STR_INFO_3;
+ nInfoStrResId = STR_INFO_3;
else
{
- eInfoString = STR_INFO_4;
+ nInfoStrResId = STR_INFO_4;
nDest = mnApproxSize;
}
rtl::OUString aTitle;
if ( maSaveAsURL.getLength() )
{
- Reference< XURLTransformer > xURLTransformer( mxMSF->getServiceManager()->createInstanceWithContext(
- OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), mxMSF ), UNO_QUERY );
+ Reference< XURLTransformer > xURLTransformer( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.URLTransformer" ) ), mxContext ), UNO_QUERY );
if ( xURLTransformer.is() )
{
util::URL aURL, aPresentationURL;
@@ -285,7 +307,7 @@ void InformationDialog::InitDialog()
}
}
- OUString aInfoString( getString( eInfoString ) );
+ OUString aInfoString( getString( nInfoStrResId ) );
const OUString aOldSizePlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%OLDFILESIZE" ) );
const OUString aNewSizePlaceholder( RTL_CONSTASCII_USTRINGPARAM( "%NEWFILESIZE" ) );
const OUString aTitlePlaceholder( aTitle.getLength() ? OUString::createFromAscii( "%TITLE" ) : OUString::createFromAscii( "'%TITLE'" ) );
@@ -302,38 +324,106 @@ void InformationDialog::InitDialog()
if ( k >= 0 )
aInfoString = aInfoString.replaceAt( k, aTitlePlaceholder.getLength(), aTitle );
- com::sun::star::uno::Reference< com::sun::star::awt::XItemListener > xItemListener;
- InsertImage( *this,
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "aboutimage" ) ),
+
+ Reference< XControl > xImageCtrl = InsertImage( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "aboutimage" ) ),
rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "private:standardimage/query" ) ),
- 5, 5, 25, 25, sal_False );
- InsertFixedText( *this, rtl::OUString( rtl::OUString::createFromAscii( "fixedtext" ) ), aInfoString, PAGE_POS_X, 6, PAGE_WIDTH, 24, sal_True, 0 );
+ 3, 3, 25, 25, sal_False );
+ Reference< XControl > xFixedText( InsertFixedText( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "fixedtext" ) ), aInfoString, PAGE_POS_X, 6, PAGE_WIDTH, 24, sal_True, 0 ), UNO_QUERY);
+
if ( maSaveAsURL.getLength() )
- InsertCheckBox( *this, TKGet( TK_OpenNewDocument ), xItemListener, getString( STR_AUTOMATICALLY_OPEN ), PAGE_POS_X, 42, PAGE_WIDTH, 8, 1 );
- InsertButton( *this, rtl::OUString( rtl::OUString::createFromAscii( "button" ) ), mxActionListener, DIALOG_WIDTH / 2 - 25, nDialogHeight - 20, 50, 14, 2, STR_OK );
+ mxCheckBox = InsertCheckBox( TKGet( TK_OpenNewDocument ),
+ getString( STR_AUTOMATICALLY_OPEN ),
+ HID( HID_SDEXT_MINIMIZER_INFOBOX_CB_OPENNEW ),
+ PAGE_POS_X, 42,
+ PAGE_WIDTH, 8, 1 );
+ Reference< XControl> xButtonCtrl( InsertButton( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "button" ) ), DIALOG_WIDTH / 2 - 15, nDialogHeight - 20, 30, 14, 2, STR_OK ), UNO_QUERY );
sal_Bool bOpenNewDocument = mrbOpenNewDocument;
setControlProperty( TKGet( TK_OpenNewDocument ), TKGet( TK_State ), Any( (sal_Int16)bOpenNewDocument ) );
+
+ sal_Int32 nX, nY, nDlgWidth;
+ Size aSize3( 3, 3 );
+ Reference< XUnitConversion > xUnitConverter( mxDialogWindow, UNO_QUERY_THROW );
+ aSize3 = xUnitConverter->convertSizeToPixel( aSize3, util::MeasureUnit::APPFONT );
+ nX = nY = aSize3.Width;
+
+ Reference< XPropertySet > xImageProps (xImageCtrl->getModel(), UNO_QUERY_THROW );
+ Reference< graphic::XGraphic > xGraphic(
+ xImageProps->getPropertyValue(
+ OUString( RTL_CONSTASCII_USTRINGPARAM( "Graphic") ) ), UNO_QUERY_THROW );
+ if ( xGraphic.is() && xGraphic->getType() != graphic::GraphicType::EMPTY )
+ {
+ Size aSizePixel;
+ Rectangle aPosSizePixel;
+ Reference< XPropertySet > xGraphicProps( xGraphic, UNO_QUERY_THROW );
+ xGraphicProps->getPropertyValue(OUString(RTL_CONSTASCII_USTRINGPARAM("SizePixel"))) >>= aSizePixel;
+ Reference< XWindow > xImage (xImageCtrl->getPeer(), UNO_QUERY_THROW );
+
+ xImage->setPosSize( nX, nY,
+ aSizePixel.Width,
+ aSizePixel.Height,
+ awt::PosSize::POSSIZE );
+
+ nX += aSizePixel.Width + aSize3.Width;
+
+ Reference< XWindow > xLabel ( xFixedText->getPeer(), UNO_QUERY_THROW );
+ aPosSizePixel = xLabel->getPosSize();
+ xLabel->setPosSize( nX, nY,
+ aPosSizePixel.Width,
+ aPosSizePixel.Height,
+ awt::PosSize::POSSIZE );
+
+ nDlgWidth = nX + aPosSizePixel.Width + aSize3.Width;
+ nY += aPosSizePixel.Height + aSize3.Height;
+
+ if ( mxCheckBox.is() )
+ {
+ Reference< XControl > xCheckBoxCtrl( mxCheckBox, UNO_QUERY_THROW );
+ Reference< XWindow > xCheckBox( xCheckBoxCtrl->getPeer(), UNO_QUERY_THROW );
+ Rectangle aCBSize = xCheckBox->getPosSize();
+ xCheckBox->setPosSize( nX, nY,
+ aPosSizePixel.Width,
+ aCBSize.Height ,
+ awt::PosSize::POSSIZE);
+ nY += aCBSize.Height + aSize3.Height;
+ }
+
+ nY += aSize3.Height;
+ Reference< XWindow > xButton ( xButtonCtrl->getPeer(), UNO_QUERY_THROW );
+ aPosSizePixel = xButton->getPosSize();
+ xButton->setPosSize( nDlgWidth / 2 - aPosSizePixel.Width / 2,
+ nY ,
+ aPosSizePixel.Width,
+ aPosSizePixel.Height,
+ awt::PosSize::POSSIZE );
+ nY += aPosSizePixel.Height + aSize3.Height;
+ mxDialogWindow->setPosSize( 0, 0, nDlgWidth, nY, awt::PosSize::SIZE );
+ }
+
+ centerDialog();
}
// -----------------------------------------------------------------------------
-InformationDialog::InformationDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame, const rtl::OUString& rSaveAsURL, sal_Bool& rbOpenNewDocument, const sal_Int64& rSourceSize, const sal_Int64& rDestSize, const sal_Int64& rApproxSize ) :
- UnoDialog( rxMSF, rxFrame ),
- ConfigurationAccess( rxMSF, NULL ),
- mxMSF( rxMSF ),
- mxFrame( rxFrame ),
- mxActionListener( new OKActionListener( *this ) ),
+InformationDialog::InformationDialog(
+ const Reference< XComponentContext > &rxContext,
+ const Reference< XWindowPeer>& rxParent,
+ const rtl::OUString& rSaveAsURL,
+ sal_Bool& rbOpenNewDocument,
+ const sal_Int64& rSourceSize,
+ const sal_Int64& rDestSize,
+ const sal_Int64& rApproxSize )
+: UnoDialog( rxContext, rxParent ),
+ ConfigurationAccess( rxContext, NULL ),
+ mxContext( rxContext ),
mnSourceSize( rSourceSize ),
mnDestSize( rDestSize ),
mnApproxSize( rApproxSize ),
mrbOpenNewDocument( rbOpenNewDocument ),
maSaveAsURL( rSaveAsURL )
{
- Reference< XFrame > xFrame( mxController->getFrame() );
- Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() );
- Reference< XWindowPeer > xWindowPeer( xContainerWindow, UNO_QUERY_THROW );
- createWindowPeer( xWindowPeer );
+ OSL_TRACE( "InformationDialog::InformationDialog" );
+ createWindowPeer();
InitDialog();
}
@@ -342,38 +432,23 @@ InformationDialog::InformationDialog( const Reference< XComponentContext > &rxMS
InformationDialog::~InformationDialog()
{
+ OSL_TRACE( "InformationDialog::~InformationDialog" );
}
// -----------------------------------------------------------------------------
sal_Bool InformationDialog::execute()
{
+ OSL_TRACE( "InformationDialog::execute" );
UnoDialog::execute();
- if ( maSaveAsURL.getLength() )
+ if ( maSaveAsURL.getLength() && mxCheckBox.is() )
{
- sal_Int16 nInt16 = 0;
- Any aAny( getControlProperty( TKGet( TK_OpenNewDocument ), TKGet( TK_State ) ) );
- if ( aAny >>= nInt16 )
- {
- sal_Bool bOpenNewDocument = static_cast< sal_Bool >( nInt16 );
- mrbOpenNewDocument = bOpenNewDocument;
- }
+ sal_Bool bOpenNewDocument = static_cast< sal_Bool >( mxCheckBox->getState() );
+ mrbOpenNewDocument = bOpenNewDocument;
}
+
+ endExecute( sal_True );
return mbStatus;
}
-// -----------------------------------------------------------------------------
-
-void OKActionListener::actionPerformed( const ActionEvent& rEvent )
- throw ( com::sun::star::uno::RuntimeException )
-{
- if ( rEvent.ActionCommand == rtl::OUString( rtl::OUString::createFromAscii( "button" ) ) )
- {
- mrInformationDialog.endExecute( sal_True );
- }
-}
-void OKActionListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
diff --git a/sdext/source/minimizer/informationdialog.hxx b/sdext/source/minimizer/informationdialog.hxx
index 0edafc1eea62..cd3091b69d33 100644
--- a/sdext/source/minimizer/informationdialog.hxx
+++ b/sdext/source/minimizer/informationdialog.hxx
@@ -46,49 +46,68 @@
// ---------------------
// - InformationDialog -
// ---------------------
-class InformationDialog : public UnoDialog, public ConfigurationAccess
+
+class InformationDialog : public UnoDialog
+ , public ConfigurationAccess
{
public :
- InformationDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF,
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame, const rtl::OUString& rSaveAsURL,
- sal_Bool& bOpenNewDocument, const sal_Int64& nSourceSize, const sal_Int64& nDestSize, const sal_Int64& nApproxDest );
+ InformationDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent,
+ const rtl::OUString& rSaveAsURL,
+ sal_Bool& bOpenNewDocument,
+ const sal_Int64& nSourceSize,
+ const sal_Int64& nDestSize,
+ const sal_Int64& nApproxDest );
~InformationDialog();
sal_Bool execute();
-
private :
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >mxMSF;
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
- com::sun::star::uno::Reference< com::sun::star::io::XStream > mxTempFile;
-
- com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListener;
-
- void InitDialog();
-
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
sal_Int64 mnSourceSize;
sal_Int64 mnDestSize;
sal_Int64 mnApproxSize;
sal_Bool& mrbOpenNewDocument;
const rtl::OUString& maSaveAsURL;
+ com::sun::star::uno::Reference< com::sun::star::awt::XCheckBox > mxCheckBox;
-public :
-
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame>& GetFrame() { return mxFrame; };
- const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& GetComponentContext() { return mxMSF; };
-};
-
-class OKActionListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener >
-{
-public:
- OKActionListener( InformationDialog& rInformationDialog ) : mrInformationDialog( rInformationDialog ){};
-
- virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
+ void InitDialog();
+ com::sun::star::uno::Reference< com::sun::star::awt::XFixedText > InsertFixedText(
+ const rtl::OUString& rControlName,
+ const rtl::OUString& rLabel,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bMultiLine,
+ sal_Int16 nTabIndex );
+ com::sun::star::uno::Reference< com::sun::star::awt::XControl > InsertImage(
+ const rtl::OUString& rControlName,
+ const rtl::OUString& rURL,
+ sal_Int32 nPosX,
+ sal_Int32 nPosY,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bScale );
+ com::sun::star::uno::Reference< com::sun::star::awt::XCheckBox > InsertCheckBox(
+ const rtl::OUString& rControlName,
+ const rtl::OUString& rLabel,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex );
+ com::sun::star::uno::Reference< com::sun::star::awt::XButton > InsertButton(
+ const rtl::OUString& rControlName,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex,
+ sal_Int32 nResID );
- InformationDialog& mrInformationDialog;
};
#endif
diff --git a/sdext/source/minimizer/makefile.mk b/sdext/source/minimizer/makefile.mk
index f99c5f9fc698..da8b494ea5dd 100644
--- a/sdext/source/minimizer/makefile.mk
+++ b/sdext/source/minimizer/makefile.mk
@@ -1,5 +1,5 @@
#**************************************************************
-#
+#
# 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
@@ -7,143 +7,91 @@
# 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
-#
+#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
-#
+#
#**************************************************************
-
-
PRJ=..$/..
PRJNAME=sdext
-TARGET=SunPresentationMinimizer
+TARGET=PresentationMinimizer
+EXTENSIONNAME=$(TARGET)
+
GEN_HID=FALSE
ENABLE_EXCEPTIONS=TRUE
# --- Settings ----------------------------------
.INCLUDE : settings.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : $(PRJ)$/source$/minimizer$/minimizer.pmk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-# set in minimizer.pmk
-#EXTENSIONNAME:=PresentationMinimizer
-EXTENSION_ZIPNAME:=presentation-minimizer
+.IF "$(L10N_framework)"==""
-.IF "$(ENABLE_MINIMIZER)" != "YES"
-@all:
- @echo "Presentation Minimizer build disabled."
-.ENDIF
DLLPRE=
# --- Files -------------------------------------
-SLOFILES= $(SLO)$/unodialog.obj \
- $(SLO)$/optimizerdialog.obj \
- $(SLO)$/optimizerdialogcontrols.obj \
- $(SLO)$/configurationaccess.obj \
- $(SLO)$/impoptimizer.obj \
- $(SLO)$/pppoptimizer.obj \
- $(SLO)$/pppoptimizeruno.obj \
- $(SLO)$/pppoptimizertoken.obj \
- $(SLO)$/pppoptimizerdialog.obj \
- $(SLO)$/fileopendialog.obj \
- $(SLO)$/optimizationstats.obj \
- $(SLO)$/graphiccollector.obj \
- $(SLO)$/pagecollector.obj \
- $(SLO)$/informationdialog.obj
+SLOFILES=\
+ $(SLO)$/unodialog.obj \
+ $(SLO)$/optimizerdialog.obj \
+ $(SLO)$/informationdialog.obj \
+ $(SLO)$/fileopendialog.obj \
+ $(SLO)$/optimizerdialogcontrols.obj \
+ $(SLO)$/configurationaccess.obj \
+ $(SLO)$/impoptimizer.obj \
+ $(SLO)$/pppoptimizer.obj \
+ $(SLO)$/pppoptimizeruno.obj \
+ $(SLO)$/pppoptimizertoken.obj \
+ $(SLO)$/pppoptimizerdialog.obj \
+ $(SLO)$/optimizationstats.obj \
+ $(SLO)$/graphiccollector.obj \
+ $(SLO)$/pagecollector.obj \
# --- Library -----------------------------------
-SHL1TARGET= $(TARGET).uno
+SHL1TARGET= $(TARGET).uno
-SHL1STDLIBS= $(CPPUHELPERLIB) \
- $(CPPULIB) \
- $(SALLIB)
+SHL1STDLIBS=\
+ $(CPPUHELPERLIB)\
+ $(CPPULIB)\
+ $(SALLIB)
SHL1DEPN=
-SHL1IMPLIB= i$(SHL1TARGET)
-SHL1LIBS= $(SLB)$/$(TARGET).lib
-SHL1DEF= $(MISC)$/$(SHL1TARGET).def
-SHL1VERSIONMAP=$(SOLARENV)/src/reg-component.map
-SHL1RPATH= OXT
-DEF1NAME= $(SHL1TARGET)
-
-COMPONENT_XCU_REPLACEMENT=s/@MINIMIZEREXTENSIONPRODUCTNAME@/Presentation Minimizer/g
-
-COMPONENT_MERGED_XCU= \
- $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/Addons.xcu \
- $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/ProtocolHandler.xcu \
- $(EXTENSIONDIR)$/registry$/data$/org$/openoffice$/Office$/extension$/SunPresentationMinimizer.xcu
-
-COMPONENT_FILES= \
- $(EXTENSIONDIR)$/registry$/schema$/org$/openoffice$/Office$/extension$/SunPresentationMinimizer.xcs
-
-# native libraries
-COMPONENT_LIBRARIES= \
- $(EXTENSIONDIR)$/SunPresentationMinimizer.uno$(DLLPOST)
-
-# rather freestyle or common to all?
-COMPONENT_BITMAPS= \
- $(EXTENSIONDIR)$/bitmaps$/opt_16.png \
- $(EXTENSIONDIR)$/bitmaps$/opt_26.png \
- $(EXTENSIONDIR)$/bitmaps$/opt_16_h.png \
- $(EXTENSIONDIR)$/bitmaps$/opt_26_h.png \
- $(EXTENSIONDIR)$/bitmaps$/minimizepresi_80.png \
- $(EXTENSIONDIR)$/bitmaps$/minimizepresi_80_h.png
-
-COMPONENT_IMAGES=\
- $(EXTENSIONDIR)$/bitmaps$/extension_32.png \
- $(EXTENSIONDIR)$/bitmaps$/extension_32_h.png
-
-# rather freestyle or common to all?
-COMPONENT_HELP= \
- $(EXTENSIONDIR)$/help$/help_de.odt \
- $(EXTENSIONDIR)$/help$/help_en-US.odt \
- $(EXTENSIONDIR)$/help$/component.txt
-
-# make sure to add your custom files here
-EXTENSION_PACKDEPS=$(COMPONENT_BITMAPS) $(COMPONENT_IMAGES) $(COMPONENT_HELP)
-
-ZIP2TARGET= presentation_minimizer_develop
-.IF "$(WITH_LANG)"!=""
-ZIP2DIR= $(MISC)/$(EXTENSIONNAME)_in/merge
-.ELSE # "$(WITH_LANG)"!=""
-ZIP2DIR= registry/data
-.ENDIF # "$(WITH_LANG)"!=""
-ZIP2EXT= .zip
-ZIP2FLAGS=-r
-ZIP2LIST= \
- org/openoffice/Office/Addons.xcu \
- org/openoffice/Office/extension/*.xcu
+SHL1IMPLIB=i$(SHL1TARGET)
+SHL1LIBS=$(SLB)$/$(TARGET).lib
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+SHL1VERSIONMAP=$(SOLARENV)/src/component.map
+SHL1RPATH=OXT
+DEF1NAME=$(SHL1TARGET)
-# --- Targets ----------------------------------
+# ------------------------------------------------------------------------------
-.INCLUDE : extension_pre.mk
+# Resource files
-.ENDIF # L10N_framework
-.INCLUDE : target.mk
+SRS1NAME=minimizer
+SRC1FILES = \
+ minimizer.src \
-.IF "$(L10N_framework)"==""
-.INCLUDE : extension_post.mk
-
-$(COMPONENT_BITMAPS) : $(SOLARSRC)$/$(RSCDEFIMG)$/minimizer$/$$(@:f)
- @@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
+SRSFILELIST=\
+ $(SRS)$/minimizer.srs \
-$(COMPONENT_IMAGES) : $(SOLARSRC)$/$(RSCDEFIMG)$/desktop$/res$/$$(@:f)
- @@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
+RESLIB1NAME=minimizer
+RESLIB1SRSFILES= $(SRSFILELIST)
-$(COMPONENT_HELP) : help$/$$(@:f)
- @@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
+# --- Targets ----------------------------------
.ENDIF # L10N_framework
+.INCLUDE : target.mk
+
+
+ALLTAR : $(MISC)/PresentationMinimizer.component
+
+$(MISC)/PresentationMinimizer.component .ERRREMOVE : $(SOLARENV)/bin/createcomponent.xslt PresentationMinimizer.component
+ $(XSLTPROC) --nonet --stringparam uri \
+ '$(COMPONENTPREFIX_BASIS_NATIVE)$(SHL1TARGETN:f)' -o $@ \
+ $(SOLARENV)/bin/createcomponent.xslt PresentationMinimizer.component
diff --git a/sdext/source/minimizer/manifest.xml b/sdext/source/minimizer/manifest.xml
deleted file mode 100644
index 5d19e783a1bb..000000000000
--- a/sdext/source/minimizer/manifest.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE manifest:manifest PUBLIC "-//OpenOffice.org//DTD Manifest 1.0//EN" "Manifest.dtd">
-<!--***********************************************************
- *
- * 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
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- ***********************************************************-->
-<manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest">
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-component;type=native"
- manifest:full-path="SunPresentationMinimizer.unoSHARED_EXTENSION"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-schema"
- manifest:full-path="registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
- manifest:full-path="registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
- manifest:full-path="registry/data/org/openoffice/Office/Addons.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data"
- manifest:full-path="registry/data/org/openoffice/Office/ProtocolHandler.xcu"/>
- <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description"
- manifest:full-path="help/component.txt"/>
-</manifest:manifest>
diff --git a/sdext/source/minimizer/minimizer.hrc b/sdext/source/minimizer/minimizer.hrc
new file mode 100644
index 000000000000..4aa7426b6541
--- /dev/null
+++ b/sdext/source/minimizer/minimizer.hrc
@@ -0,0 +1,95 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#define MINIMIZER_RES_START 255
+
+#define IMAGE_MINIMIZER_ROADMAP MINIMIZER_RES_START + 1
+#define IMAGE_MINIMIZER_ROADMAP_HC MINIMIZER_RES_START + 2
+
+#define IMAGE_MINIMIZER_END MINIMIZER_RES_START + 50
+#define MINIMIZER_RES_STR_START IMAGE_MINIMIZER_END
+
+#define STR_PRESENTATION_MINIMIZER MINIMIZER_RES_STR_START + 1
+#define STR_STEPS MINIMIZER_RES_STR_START + 2
+#define STR_HELP MINIMIZER_RES_STR_START + 3
+#define STR_BACK MINIMIZER_RES_STR_START + 4
+#define STR_NEXT MINIMIZER_RES_STR_START + 5
+#define STR_FINISH MINIMIZER_RES_STR_START + 6
+#define STR_CANCEL MINIMIZER_RES_STR_START + 7
+#define STR_INTRODUCTION MINIMIZER_RES_STR_START + 8
+#define STR_INTRODUCTION_T MINIMIZER_RES_STR_START + 9
+#define STR_CHOSE_SETTINGS MINIMIZER_RES_STR_START + 10
+#define STR_REMOVE MINIMIZER_RES_STR_START + 11
+#define STR_GRAPHIC_OPTIMIZATION MINIMIZER_RES_STR_START + 12
+#define STR_IMAGE_OPTIMIZATION MINIMIZER_RES_STR_START + 13
+#define STR_LOSSLESS_COMPRESSION MINIMIZER_RES_STR_START + 14
+#define STR_JPEG_COMPRESSION MINIMIZER_RES_STR_START + 15
+#define STR_QUALITY MINIMIZER_RES_STR_START + 16
+#define STR_REMOVE_CROP_AREA MINIMIZER_RES_STR_START + 17
+#define STR_IMAGE_RESOLUTION MINIMIZER_RES_STR_START + 18
+#define STR_IMAGE_RESOLUTION_0 MINIMIZER_RES_STR_START + 19
+#define STR_IMAGE_RESOLUTION_1 MINIMIZER_RES_STR_START + 20
+#define STR_IMAGE_RESOLUTION_2 MINIMIZER_RES_STR_START + 21
+#define STR_IMAGE_RESOLUTION_3 MINIMIZER_RES_STR_START + 22
+#define STR_EMBED_LINKED_GRAPHICS MINIMIZER_RES_STR_START + 23
+#define STR_OLE_OBJECTS MINIMIZER_RES_STR_START + 24
+#define STR_OLE_OPTIMIZATION MINIMIZER_RES_STR_START + 25
+#define STR_OLE_REPLACE MINIMIZER_RES_STR_START + 26
+#define STR_ALL_OLE_OBJECTS MINIMIZER_RES_STR_START + 27
+#define STR_ALIEN_OLE_OBJECTS_ONLY MINIMIZER_RES_STR_START + 28
+#define STR_OLE_OBJECTS_DESC MINIMIZER_RES_STR_START + 29
+#define STR_NO_OLE_OBJECTS_DESC MINIMIZER_RES_STR_START + 30
+#define STR_SLIDES MINIMIZER_RES_STR_START + 31
+#define STR_CHOOSE_SLIDES MINIMIZER_RES_STR_START + 32
+#define STR_MASTER_PAGES MINIMIZER_RES_STR_START + 33
+#define STR_DELETE_MASTER_PAGES MINIMIZER_RES_STR_START + 34
+#define STR_DELETE_NOTES_PAGES MINIMIZER_RES_STR_START + 35
+#define STR_DELETE_HIDDEN_SLIDES MINIMIZER_RES_STR_START + 36
+#define STR_CUSTOM_SHOW MINIMIZER_RES_STR_START + 37
+#define STR_SUMMARY MINIMIZER_RES_STR_START + 38
+#define STR_SUMMARY_TITLE MINIMIZER_RES_STR_START + 39
+#define STR_PROGRESS MINIMIZER_RES_STR_START + 40
+#define STR_OBJECTS_OPTIMIZED MINIMIZER_RES_STR_START + 41
+#define STR_APPLY_TO_CURRENT MINIMIZER_RES_STR_START + 42
+#define STR_AUTOMATICALLY_OPEN MINIMIZER_RES_STR_START + 43
+#define STR_SAVE_SETTINGS MINIMIZER_RES_STR_START + 44
+#define STR_SAVE_AS MINIMIZER_RES_STR_START + 45
+#define STR_DELETE_SLIDES MINIMIZER_RES_STR_START + 46
+#define STR_OPTIMIZE_IMAGES MINIMIZER_RES_STR_START + 47
+#define STR_CREATE_REPLACEMENT MINIMIZER_RES_STR_START + 48
+#define STR_CURRENT_FILESIZE MINIMIZER_RES_STR_START + 49
+#define STR_ESTIMATED_FILESIZE MINIMIZER_RES_STR_START + 50
+#define STR_MB MINIMIZER_RES_STR_START + 51
+#define STR_MY_SETTINGS MINIMIZER_RES_STR_START + 52
+#define STR_DEFAULT_SESSION MINIMIZER_RES_STR_START + 53
+#define STR_MODIFY_WARNING MINIMIZER_RES_STR_START + 54
+#define STR_YES MINIMIZER_RES_STR_START + 55
+#define STR_OK MINIMIZER_RES_STR_START + 56
+#define STR_INFO_1 MINIMIZER_RES_STR_START + 57
+#define STR_INFO_2 MINIMIZER_RES_STR_START + 58
+#define STR_INFO_3 MINIMIZER_RES_STR_START + 59
+#define STR_INFO_4 MINIMIZER_RES_STR_START + 60
+#define STR_DUPLICATING_PRESENTATION MINIMIZER_RES_STR_START + 61
+#define STR_DELETING_SLIDES MINIMIZER_RES_STR_START + 62
+#define STR_OPTIMIZING_GRAPHICS MINIMIZER_RES_STR_START + 63
+#define STR_CREATING_OLE_REPLACEMENTS MINIMIZER_RES_STR_START + 64
+#define STR_FILESIZESEPARATOR MINIMIZER_RES_STR_START + 65
+#define STR_INFO_DIALOG MINIMIZER_RES_STR_START + 66
diff --git a/sdext/source/minimizer/minimizer.pmk b/sdext/source/minimizer/minimizer.pmk
deleted file mode 100644
index 1839e2505686..000000000000
--- a/sdext/source/minimizer/minimizer.pmk
+++ /dev/null
@@ -1,24 +0,0 @@
-#**************************************************************
-#
-# 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
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-
-EXTENSIONNAME:=PresentationMinimizer
diff --git a/sdext/source/minimizer/minimizer.src b/sdext/source/minimizer/minimizer.src
new file mode 100644
index 000000000000..b4edfd48a0de
--- /dev/null
+++ b/sdext/source/minimizer/minimizer.src
@@ -0,0 +1,379 @@
+/**************************************************************
+ *
+ * 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
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+#include "minimizer.hrc"
+
+Bitmap IMAGE_MINIMIZER_ROADMAP
+{
+ File = "minimizer/minimizepresi_80.png";
+};
+
+Bitmap IMAGE_MINIMIZER_ROADMAP_HC
+{
+ File = "minimizer/minimizepresi_80_h.png";
+};
+
+String STR_PRESENTATION_MINIMIZER
+{
+ Text[ en-US ] = "Presentation Minimizer";
+};
+
+String STR_INFO_DIALOG
+{
+ Text[ en-US ] = "Presentation Minimizer - Result";
+};
+
+String STR_STEPS
+{
+ Text[ en-US ] = "Steps";
+};
+
+String STR_HELP
+{
+ Text[ en-US ] = "~Help";
+};
+
+String STR_BACK
+{
+ Text[ en-US ] = "< ~Back";
+};
+
+String STR_NEXT
+{
+ Text[ en-US ] = "~Next >";
+};
+
+String STR_FINISH
+{
+ Text[ en-US ] = "~Finish";
+};
+
+String STR_CANCEL
+{
+ Text[ en-US ] = "Cancel";
+};
+
+String STR_INTRODUCTION
+{
+ Text[ en-US ] = "Introduction";
+};
+
+String STR_INTRODUCTION_T
+{
+ Text[ en-US ] = "The Presentation Minimizer is used to reduce the "
+ "file size of the current presentation. Images will be compressed and "
+ "data, that is no longer needed, will be removed.\n"
+ "At the last step of the wizard you can choose to apply the changes "
+ "to the current presentation or to create an optimized new version of"
+ " the presentation.";
+};
+
+String STR_CHOSE_SETTINGS
+{
+ Text[ en-US ] = "~Choose settings for Presentation Minimizer";
+};
+
+String STR_REMOVE
+{
+ Text[ en-US ] = "~Delete";
+};
+
+String STR_GRAPHIC_OPTIMIZATION
+{
+ Text[ en-US ] = "Choose settings for optimizing pictures and graphics";
+};
+
+String STR_IMAGE_OPTIMIZATION
+{
+ Text[ en-US ] = "Graphics";
+};
+
+String STR_LOSSLESS_COMPRESSION
+{
+ Text[ en-US ] = "~Lossless compression";
+};
+
+String STR_JPEG_COMPRESSION
+{
+ Text[ en-US ] = "~JPEG compression";
+};
+
+String STR_QUALITY
+{
+ Text[ en-US ] = "~Quality in %";
+};
+
+String STR_REMOVE_CROP_AREA
+{
+ Text[ en-US ] = "~Delete cropped graphic areas";
+};
+
+String STR_IMAGE_RESOLUTION
+{
+ Text[ en-US ] = "Reduce ~image resolution";
+};
+
+String STR_IMAGE_RESOLUTION_0
+{
+ Text[ en-US ] = "<no change>";
+};
+
+String STR_IMAGE_RESOLUTION_1
+{
+ Text[ en-US ] = "90;90 DPI (screen resolution)";
+};
+
+String STR_IMAGE_RESOLUTION_2
+{
+ Text[ en-US ] = "150;150 DPI (projector resolution)";
+};
+
+String STR_IMAGE_RESOLUTION_3
+{
+ Text[ en-US ] = "300;300 DPI (print resolution)";
+};
+
+String STR_EMBED_LINKED_GRAPHICS
+{
+ Text[ en-US ] = "~Break links to external graphics";
+};
+
+String STR_OLE_OBJECTS
+{
+ Text[ en-US ] = "OLE Objects";
+};
+
+String STR_OLE_OPTIMIZATION
+{
+ Text[ en-US ] = "Choose settings for replacing OLE objects";
+};
+
+String STR_OLE_REPLACE
+{
+ Text[ en-US ] = "Create static replacement graphics for OLE objects";
+};
+
+String STR_ALL_OLE_OBJECTS
+{
+ Text[ en-US ] = "For ~all OLE objects";
+};
+
+String STR_ALIEN_OLE_OBJECTS_ONLY
+{
+ Text[ en-US ] = "~For OLE objects not based on OpenDocument format";
+};
+
+String STR_OLE_OBJECTS_DESC
+{
+ Text[ en-US ] = "Object Linking and Embedding (OLE) is a technology that "
+ "allows embedding and linking to documents and other objects.\n"
+ "The current presentation contains OLE objects.";
+};
+
+String STR_NO_OLE_OBJECTS_DESC
+{
+ Text[ en-US ] = "Object Linking and Embedding (OLE) is a technology that "
+ "allows embedding and linking to documents and other objects.\n"
+ "The current presentation contains no OLE objects.";
+};
+
+String STR_SLIDES
+{
+ Text[ en-US ] = "Slides";
+};
+
+String STR_CHOOSE_SLIDES
+{
+ Text[ en-US ] = "Choose which slides to delete";
+};
+
+String STR_MASTER_PAGES
+{
+ Text[ en-US ] = "Master Pages";
+};
+
+String STR_DELETE_MASTER_PAGES
+{
+ Text[ en-US ] = "Delete unused ~master pages";
+};
+
+String STR_DELETE_NOTES_PAGES
+{
+ Text[ en-US ] = "~Clear notes";
+};
+
+String STR_DELETE_HIDDEN_SLIDES
+{
+ Text[ en-US ] = "Delete hidden ~slides";
+};
+
+String STR_CUSTOM_SHOW
+{
+ Text[ en-US ] = "Delete slides that are not used for the ~custom slide show";
+};
+
+String STR_SUMMARY
+{
+ Text[ en-US ] = "Summary";
+};
+
+String STR_SUMMARY_TITLE
+{
+ Text[ en-US ] = "Choose where to apply the following changes";
+};
+
+String STR_PROGRESS
+{
+ Text[ en-US ] = "Progress";
+};
+
+String STR_OBJECTS_OPTIMIZED
+{
+ Text[ en-US ] = "Objects optimized";
+};
+
+String STR_APPLY_TO_CURRENT
+{
+ Text[ en-US ] = "~Apply changes to current presentation";
+};
+
+String STR_AUTOMATICALLY_OPEN
+{
+ Text[ en-US ] = "~Open newly created presentation";
+};
+
+String STR_SAVE_SETTINGS
+{
+ Text[ en-US ] = "~Save settings as";
+};
+
+String STR_SAVE_AS
+{
+ Text[ en-US ] = "~Duplicate presentation before applying changes";
+};
+
+String STR_DELETE_SLIDES
+{
+ Text[ en-US ] = "Delete %SLIDES slides.";
+};
+
+String STR_OPTIMIZE_IMAGES
+{
+ Text[ en-US ] = "Optimize %IMAGES graphics to %QUALITY% JPEG quality at %RESOLUTION DPI.";
+};
+
+String STR_CREATE_REPLACEMENT
+{
+ Text[ en-US ] = "Create replacement graphics for %OLE objects.";
+};
+
+String STR_CURRENT_FILESIZE
+{
+ Text[ en-US ] = "Current file size:";
+};
+
+String STR_ESTIMATED_FILESIZE
+{
+ Text[ en-US ] = "Estimated new file size:";
+};
+
+String STR_MB
+{
+ Text[ en-US ] = "%1 MB";
+};
+
+String STR_MY_SETTINGS
+{
+ Text[ en-US ] = "My Settings ";
+};
+
+String STR_DEFAULT_SESSION
+{
+ Text[ en-US ] = "default session";
+};
+
+String STR_MODIFY_WARNING
+{
+ Text[ en-US ] = "The optimization will modify the current document. "
+ "Do you want to continue?";
+};
+
+String STR_YES
+{
+ Text[ en-US ] = "~Yes";
+};
+
+String STR_OK
+{
+ Text[ en-US ] = "OK";
+};
+
+String STR_INFO_1
+{
+ Text[ en-US ] = "The Presentation Minimizer has successfully updated the "
+ "presentation '%TITLE'. The file size has changed "
+ "from %OLDFILESIZE MB to %NEWFILESIZE MB.";
+};
+
+String STR_INFO_2
+{
+ Text[ en-US ] = "The Presentation Minimizer has successfully updated the "
+ "presentation '%TITLE'. The file size has changed "
+ "from %OLDFILESIZE MB to approximated %NEWFILESIZE MB.";
+};
+
+String STR_INFO_3
+{
+ Text[ en-US ] = "The Presentation Minimizer has successfully updated the "
+ "presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB.";
+};
+
+String STR_INFO_4
+{
+ Text[ en-US ] = "The Presentation Minimizer has successfully updated the "
+ "presentation '%TITLE'. "
+ "The file size has changed to approximated %NEWFILESIZE MB.";
+};
+
+String STR_DUPLICATING_PRESENTATION
+{
+ Text[ en-US ] = "Duplicating presentation...";
+};
+
+String STR_DELETING_SLIDES
+{
+ Text[ en-US ] = "Deleting slides...";
+};
+
+String STR_OPTIMIZING_GRAPHICS
+{
+ Text[ en-US ] = "Optimizing graphics...";
+};
+
+String STR_CREATING_OLE_REPLACEMENTS
+{
+ Text[ en-US ] = "Creating replacement graphics for OLE objects...";
+};
+
+String STR_FILESIZESEPARATOR
+{
+ Text[ en-US ] = ".";
+};
diff --git a/sdext/source/minimizer/optimizationstats.cxx b/sdext/source/minimizer/optimizationstats.cxx
index b0f41f3cb2df..a087e7868f9a 100644
--- a/sdext/source/minimizer/optimizationstats.cxx
+++ b/sdext/source/minimizer/optimizationstats.cxx
@@ -31,13 +31,14 @@
#include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::beans;
+using ::rtl::OUString;
+
// -----------------------------------------------------------------------------
OptimizationStats::OptimizationStats()
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index c647a22fff61..c546141d24b3 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -34,14 +34,22 @@
#endif
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
#include <osl/time.h>
+#include "minimizer.hrc"
+#include "helpid.hrc"
+
+#define URL_GRAPHIC_REPO "private:graphicrepository"
+#define IMAGE_ROADMAP URL_GRAPHIC_REPO "/minimizer/minimizepresi_80.png"
+#define IMAGE_ROADMAP_HC URL_GRAPHIC_REPO "/minimizer/minimizepresi_80.png"
+
// -------------------
// - OPTIMIZERDIALOG -
// -------------------
-using namespace ::rtl;
using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::graphic;
using namespace ::com::sun::star::ui;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::ucb;
@@ -53,6 +61,7 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::script;
using namespace ::com::sun::star::container;
+using ::rtl::OUString;
// -----------------------------------------------------------------------------
@@ -62,6 +71,7 @@ void OptimizerDialog::InitDialog()
OUString pNames[] = {
TKGet( TK_Closeable ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_Moveable ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -71,10 +81,11 @@ void OptimizerDialog::InitDialog()
Any pValues[] = {
Any( sal_True ),
Any( sal_Int32( DIALOG_HEIGHT ) ),
+ Any( HID( HID_SDEXT_MINIMIZER_WIZ_DLG ) ),
Any( sal_True ),
Any( sal_Int32( 200 ) ),
Any( sal_Int32( 52 ) ),
- Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ),
+ Any( getString( STR_PRESENTATION_MINIMIZER ) ),
Any( sal_Int32( OD_DIALOG_WIDTH ) ) };
sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString );
@@ -124,12 +135,12 @@ void OptimizerDialog::InitRoadmap()
InsertRoadmapItem( 3, sal_True, getString( STR_OLE_OBJECTS ), ITEM_ID_OLE_OPTIMIZATION );
InsertRoadmapItem( 4, sal_True, getString( STR_SUMMARY ), ITEM_ID_SUMMARY );
- rtl::OUString sBitmapPath( getPath( TK_BitmapPath ) );
- rtl::OUString sBitmap( isHighContrast() ? rtl::OUString::createFromAscii( "/minimizepresi_80_h.png" )
- : rtl::OUString::createFromAscii( "/minimizepresi_80.png" ) );
- rtl::OUString sURL( sBitmapPath += sBitmap );
+ rtl::OUString sBitmap(
+ isHighContrast() ?
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMAGE_ROADMAP_HC ) ) :
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( IMAGE_ROADMAP ) ) );
- xPropertySet->setPropertyValue( TKGet( TK_ImageURL ), Any( sURL ) );
+ xPropertySet->setPropertyValue( TKGet( TK_ImageURL ), Any( sBitmap ) );
xPropertySet->setPropertyValue( TKGet( TK_Activated ), Any( (sal_Bool)sal_True ) );
xPropertySet->setPropertyValue( TKGet( TK_Complete ), Any( (sal_Bool)sal_True ) );
xPropertySet->setPropertyValue( TKGet( TK_CurrentItemID ), Any( (sal_Int16)ITEM_ID_INTRODUCTION ) );
@@ -213,22 +224,21 @@ void OptimizerDialog::UpdateConfiguration()
// -----------------------------------------------------------------------------
-OptimizerDialog::OptimizerDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame, Reference< XDispatch > rxStatusDispatcher ) :
- UnoDialog( rxMSF, rxFrame ),
- ConfigurationAccess( rxMSF, NULL ),
- mnCurrentStep( 0 ),
- mnTabIndex( 0 ),
- mxMSF( rxMSF ),
- mxFrame( rxFrame ),
- mxItemListener( new ItemListener( *this ) ),
- mxActionListener( new ActionListener( *this ) ),
- mxActionListenerListBox0Pg0( new ActionListenerListBox0Pg0( *this ) ),
- mxTextListenerFormattedField0Pg1( new TextListenerFormattedField0Pg1( *this ) ),
- mxTextListenerComboBox0Pg1( new TextListenerComboBox0Pg1( *this ) ),
- mxSpinListenerFormattedField0Pg1( new SpinListenerFormattedField0Pg1( *this ) ),
- mxStatusDispatcher( rxStatusDispatcher )
+OptimizerDialog::OptimizerDialog(
+ const Reference< XComponentContext > &rxContext,
+ const Reference< XFrame > &rxFrame,
+ const Reference< XWindowPeer >& rxParent )
+ : UnoDialog( rxContext, rxParent )
+ , ConfigurationAccess( rxContext, NULL )
+ , mxFrame( rxFrame )
+ , mnCurrentStep( 0 )
+ , mnTabIndex( 0 )
{
- Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY_THROW );
+ OSL_TRACE("OptimizerDialog::OptimizerDialog");
+ OSL_ENSURE( mxFrame.is(), "OptimizerDialog: no XFrame!" );
+ Reference< XController > xController( mxFrame->getController() );
+ mxModel = xController->getModel();
+ Reference< XStorable> xStorable( mxModel, UNO_QUERY_THROW );
mbIsReadonly = xStorable->isReadonly();
InitDialog();
@@ -242,29 +252,54 @@ OptimizerDialog::OptimizerDialog( const Reference< XComponentContext > &rxMSF, R
ActivatePage( 0 );
OptimizationStats aStats;
- aStats.InitializeStatusValuesFromDocument( mxController->getModel() );
+ aStats.InitializeStatusValuesFromDocument( mxModel );
Sequence< PropertyValue > aStatusSequence( aStats.GetStatusSequence() );
UpdateStatus( aStatusSequence );
+
+ centerDialog();
}
// -----------------------------------------------------------------------------
OptimizerDialog::~OptimizerDialog()
{
+ OSL_TRACE("OptimizerDialog::~OptimizerDialog");
// not saving configuration if the dialog has been finished via cancel or close window
if ( mbStatus )
SaveConfiguration();
+
+ Reference< XComponent > xComponent( mxDialog, UNO_QUERY );
+ if ( xComponent.is() )
+ {
+ OSL_TRACE("OptimizerDialog::~OptimizerDialog - disposing dialog!");
+ xComponent->dispose();
+ }
+}
+
+
+void SAL_CALL OptimizerDialog::statusChanged(
+ const ::com::sun::star::frame::FeatureStateEvent& aState )
+throw (::com::sun::star::uno::RuntimeException)
+{
+ Sequence< PropertyValue > aArguments;
+ if ( ( aState.State >>= aArguments ) && aArguments.getLength() )
+ UpdateStatus( aArguments );
}
+void SAL_CALL OptimizerDialog::disposing(
+ const ::com::sun::star::lang::EventObject& /*aSource*/ )
+throw (::com::sun::star::uno::RuntimeException)
+{}
+
// -----------------------------------------------------------------------------
sal_Bool OptimizerDialog::execute()
{
Reference< XItemEventBroadcaster > maRoadmapBroadcaster( mxRoadmapControl, UNO_QUERY_THROW );
- maRoadmapBroadcaster->addItemListener( mxItemListener );
+ maRoadmapBroadcaster->addItemListener( this );
UnoDialog::execute();
UpdateConfiguration(); // taking actual control settings for the configuration
- maRoadmapBroadcaster->removeItemListener( mxItemListener );
+ maRoadmapBroadcaster->removeItemListener( this );
return mbStatus;
}
@@ -350,7 +385,7 @@ void OptimizerDialog::UpdateStatus( const com::sun::star::uno::Sequence< com::su
if ( *pVal >>= sStatus )
{
setControlProperty( TKGet( TK_FixedText1Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) );
- setControlProperty( TKGet( TK_FixedText1Pg4 ), TKGet( TK_Label ), Any( getString( TKGet( sStatus ) ) ) );
+ setControlProperty( TKGet( TK_FixedText1Pg4 ), TKGet( TK_Label ), Any( sStatus ) );
}
}
pVal = maStats.GetStatusValue( TK_Progress );
@@ -370,7 +405,7 @@ void OptimizerDialog::UpdateStatus( const com::sun::star::uno::Sequence< com::su
// -----------------------------------------------------------------------------
-void ItemListener::itemStateChanged( const ItemEvent& Event )
+void OptimizerDialog::itemStateChanged( const ItemEvent& Event )
throw ( RuntimeException )
{
try
@@ -388,28 +423,28 @@ void ItemListener::itemStateChanged( const ItemEvent& Event )
{
case TK_rdmNavi :
{
- mrOptimizerDialog.SwitchPage( static_cast< sal_Int16 >( Event.ItemId ) );
+ SwitchPage( static_cast< sal_Int16 >( Event.ItemId ) );
}
break;
case TK_CheckBox1Pg1 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_RemoveCropArea, Any( nState != 0 ) );
+ SetConfigProperty( TK_RemoveCropArea, Any( nState != 0 ) );
}
break;
case TK_CheckBox2Pg1 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_EmbedLinkedGraphics, Any( nState != 0 ) );
+ SetConfigProperty( TK_EmbedLinkedGraphics, Any( nState != 0 ) );
}
break;
case TK_CheckBox0Pg2 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
{
- mrOptimizerDialog.SetConfigProperty( TK_OLEOptimization, Any( nState != 0 ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_RadioButton0Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_RadioButton1Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
+ SetConfigProperty( TK_OLEOptimization, Any( nState != 0 ) );
+ setControlProperty( TKGet( TK_RadioButton0Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
+ setControlProperty( TKGet( TK_RadioButton1Pg2 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
}
}
break;
@@ -419,9 +454,9 @@ void ItemListener::itemStateChanged( const ItemEvent& Event )
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nInt16 )
{
nInt16 ^= 1;
- mrOptimizerDialog.SetConfigProperty( TK_JPEGCompression, Any( nInt16 != 0 ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) );
+ SetConfigProperty( TK_JPEGCompression, Any( nInt16 != 0 ) );
+ setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) );
+ setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nInt16 != 0 ) );
}
}
break;
@@ -429,9 +464,9 @@ void ItemListener::itemStateChanged( const ItemEvent& Event )
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
{
- mrOptimizerDialog.SetConfigProperty( TK_JPEGCompression, Any( nState != 0 ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
+ SetConfigProperty( TK_JPEGCompression, Any( nState != 0 ) );
+ setControlProperty( TKGet( TK_FixedText1Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
+ setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
}
}
break;
@@ -441,51 +476,51 @@ void ItemListener::itemStateChanged( const ItemEvent& Event )
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nInt16 )
{
nInt16 ^= 1;
- mrOptimizerDialog.SetConfigProperty( TK_OLEOptimizationType, Any( nInt16 ) );
+ SetConfigProperty( TK_OLEOptimizationType, Any( nInt16 ) );
}
}
break;
case TK_RadioButton1Pg2 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_OLEOptimizationType, Any( nState ) );
+ SetConfigProperty( TK_OLEOptimizationType, Any( nState ) );
}
break;
case TK_CheckBox0Pg3 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_DeleteUnusedMasterPages, Any( nState != 0 ) );
+ SetConfigProperty( TK_DeleteUnusedMasterPages, Any( nState != 0 ) );
}
break;
case TK_CheckBox1Pg3 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_DeleteNotesPages, Any( nState != 0 ) );
+ SetConfigProperty( TK_DeleteNotesPages, Any( nState != 0 ) );
}
break;
case TK_CheckBox2Pg3 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_DeleteHiddenSlides, Any( nState != 0 ) );
+ SetConfigProperty( TK_DeleteHiddenSlides, Any( nState != 0 ) );
}
break;
case TK_CheckBox3Pg3 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.setControlProperty( TKGet( TK_ListBox0Pg3 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
+ setControlProperty( TKGet( TK_ListBox0Pg3 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
}
break;
case TK_CheckBox1Pg4 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.setControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
+ setControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Enabled ), Any( nState != 0 ) );
}
break;
case TK_RadioButton0Pg4 :
case TK_RadioButton1Pg4 :
{
if ( xPropertySet->getPropertyValue( TKGet( TK_State ) ) >>= nState )
- mrOptimizerDialog.SetConfigProperty( TK_SaveAs, Any( eControl == TK_RadioButton1Pg4 ? nState != 0 : nState == 0 ) );
+ SetConfigProperty( TK_SaveAs, Any( eControl == TK_RadioButton1Pg4 ? nState != 0 : nState == 0 ) );
}
break;
default:
@@ -495,93 +530,42 @@ void ItemListener::itemStateChanged( const ItemEvent& Event )
}
catch ( Exception& )
{
-
}
}
-void ItemListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
// -----------------------------------------------------------------------------
-void ActionListener::actionPerformed( const ActionEvent& rEvent )
+void OptimizerDialog::actionPerformed( const ActionEvent& rEvent )
throw ( com::sun::star::uno::RuntimeException )
{
switch( TKGet( rEvent.ActionCommand ) )
{
- case TK_btnNavHelp :
- {
- try
- {
- static Reference< XFrame > xHelpFrame;
- if ( !xHelpFrame.is() )
- {
- rtl::OUString sHelpFile( mrOptimizerDialog.getPath( TK_HelpFile ) );
- Reference< XDesktop > desktop( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithContext(
- OUString::createFromAscii( "com.sun.star.frame.Desktop" ), mrOptimizerDialog.GetComponentContext() ), UNO_QUERY_THROW );
- Reference< XSimpleFileAccess > xSimpleFileAccess( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithContext(
- OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), mrOptimizerDialog.GetComponentContext() ), UNO_QUERY_THROW );
- Reference< XInputStream > xInputStream( xSimpleFileAccess->openFileRead( sHelpFile ) );
- Reference< XDesktop > xDesktop( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithContext(
- OUString::createFromAscii( "com.sun.star.frame.Desktop" ), mrOptimizerDialog.GetComponentContext() ), UNO_QUERY_THROW );
- Reference< XFrame > xDesktopFrame( xDesktop, UNO_QUERY_THROW );
- xHelpFrame = Reference< XFrame >( xDesktopFrame->findFrame( TKGet( TK__blank ), 0 ) );
- Reference< XCloseBroadcaster > xCloseBroadcaster( xHelpFrame, UNO_QUERY_THROW );
- xCloseBroadcaster->addCloseListener( new HelpCloseListener( xHelpFrame ) );
- Reference< XComponentLoader > xLoader( xHelpFrame, UNO_QUERY_THROW );
-
- Sequence< PropertyValue > aLoadProps( 2 );
- aLoadProps[ 0 ].Name = TKGet( TK_ReadOnly );
- aLoadProps[ 0 ].Value <<= (sal_Bool)( sal_True );
- aLoadProps[ 1 ].Name = TKGet( TK_InputStream );
- aLoadProps[ 1 ].Value <<= xInputStream;
-
- Reference< XComponent >( xLoader->loadComponentFromURL( OUString::createFromAscii( "private:stream" ),
- TKGet( TK__self ), 0, aLoadProps ) );
-
- Reference< XPropertySet > xPropSet( xHelpFrame, UNO_QUERY_THROW );
- Reference< XLayoutManager > xLayoutManager;
- if ( xPropSet->getPropertyValue( OUString::createFromAscii( "LayoutManager" ) ) >>= xLayoutManager )
- {
- xLayoutManager->setVisible( sal_False );
- xLayoutManager->hideElement( OUString::createFromAscii( "private:resource/menubar/menubar" ) );
- xLayoutManager->destroyElement( OUString::createFromAscii( "private:resource/statusbar/statusbar" ) );
- }
- }
- }
- catch( Exception& )
- {
-
- }
- }
- break;
- case TK_btnNavBack : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep - 1 ); break;
- case TK_btnNavNext : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep + 1 ); break;
+ case TK_btnNavBack : SwitchPage( mnCurrentStep - 1 ); break;
+ case TK_btnNavNext : SwitchPage( mnCurrentStep + 1 ); break;
case TK_btnNavFinish :
{
- mrOptimizerDialog.UpdateConfiguration();
+ UpdateConfiguration();
- mrOptimizerDialog.SwitchPage( ITEM_ID_SUMMARY );
- mrOptimizerDialog.DisablePage( ITEM_ID_SUMMARY );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_False ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_False ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_False ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_False ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText0Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) );
+ SwitchPage( ITEM_ID_SUMMARY );
+ DisablePage( ITEM_ID_SUMMARY );
+ setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_False ) );
+ setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_False ) );
+ setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) );
+ setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_False ) );
+ setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_False ) );
+ setControlProperty( TKGet( TK_FixedText0Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) );
// check if we have to open the FileDialog
sal_Bool bSuccessfullyExecuted = sal_True;
sal_Int16 nInt16 = 0;
- mrOptimizerDialog.getControlProperty( TKGet( TK_RadioButton1Pg4 ), TKGet( TK_State ) ) >>= nInt16;
+ getControlProperty( TKGet( TK_RadioButton1Pg4 ), TKGet( TK_State ) ) >>= nInt16;
if ( nInt16 )
{
rtl::OUString aSaveAsURL;
- FileOpenDialog aFileOpenDialog( ((UnoDialog&)mrOptimizerDialog).mxMSF );
+ FileOpenDialog aFileOpenDialog( mxContext, Reference< XWindow >( mxParent, UNO_QUERY ) );
// generating default file name
- Reference< XStorable > xStorable( mrOptimizerDialog.mxController->getModel(), UNO_QUERY );
+ Reference< XStorable > xStorable( mxModel, UNO_QUERY );
if ( xStorable.is() && xStorable->hasLocation() )
{
rtl::OUString aLocation( xStorable->getLocation() );
@@ -608,8 +592,8 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
if ( bDialogExecuted )
{
aSaveAsURL = aFileOpenDialog.getURL();
- mrOptimizerDialog.SetConfigProperty( TK_SaveAsURL, Any( aSaveAsURL ) );
- mrOptimizerDialog.SetConfigProperty( TK_FilterName, Any( aFileOpenDialog.getFilterName() ) );
+ SetConfigProperty( TK_SaveAsURL, Any( aSaveAsURL ) );
+ SetConfigProperty( TK_FilterName, Any( aFileOpenDialog.getFilterName() ) );
}
if ( !aSaveAsURL.getLength() )
{
@@ -618,23 +602,23 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
}
// waiting for 500ms
- if ( mrOptimizerDialog.mxReschedule.is() )
+ if ( mxReschedule.is() )
{
- mrOptimizerDialog.mxReschedule->reschedule();
+ mxReschedule->reschedule();
for ( sal_uInt32 i = osl_getGlobalTimer(); ( i + 500 ) > ( osl_getGlobalTimer() ); )
- mrOptimizerDialog.mxReschedule->reschedule();
+ mxReschedule->reschedule();
}
}
if ( bSuccessfullyExecuted )
{ // now check if we have to store a session template
nInt16 = 0;
OUString aSettingsName;
- mrOptimizerDialog.getControlProperty( TKGet( TK_CheckBox1Pg4 ), TKGet( TK_State ) ) >>= nInt16;
- mrOptimizerDialog.getControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Text ) ) >>= aSettingsName;
+ getControlProperty( TKGet( TK_CheckBox1Pg4 ), TKGet( TK_State ) ) >>= nInt16;
+ getControlProperty( TKGet( TK_ComboBox0Pg4 ), TKGet( TK_Text ) ) >>= aSettingsName;
if ( nInt16 && aSettingsName.getLength() )
{
- std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( aSettingsName ) );
- std::vector< OptimizerSettings >& rSettings( mrOptimizerDialog.GetOptimizerSettings() );
+ std::vector< OptimizerSettings >::iterator aIter( GetOptimizerSettingsByName( aSettingsName ) );
+ std::vector< OptimizerSettings >& rSettings( GetOptimizerSettings() );
OptimizerSettings aNewSettings( rSettings[ 0 ] );
aNewSettings.maName = aSettingsName;
if ( aIter == rSettings.end() )
@@ -646,10 +630,10 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
if ( bSuccessfullyExecuted )
{
Sequence< Any > aArgs( 1 );
- aArgs[ 0 ] <<= mrOptimizerDialog.GetFrame();
+ aArgs[ 0 ] <<= mxFrame;
- Reference < XDispatch > xDispatch( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext(
- OUString::createFromAscii( "com.sun.star.comp.PPPOptimizer" ), aArgs, mrOptimizerDialog.GetComponentContext() ), UNO_QUERY );
+ Reference < XDispatch > xDispatch( mxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ OUString::createFromAscii( "com.sun.star.comp.PPPOptimizer" ), aArgs, mxContext ), UNO_QUERY );
URL aURL;
aURL.Protocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.com.sun.star.comp.PPPOptimizer:" ) );
@@ -657,179 +641,151 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
Sequence< PropertyValue > lArguments( 3 );
lArguments[ 0 ].Name = TKGet( TK_Settings );
- lArguments[ 0 ].Value <<= mrOptimizerDialog.GetConfigurationSequence();
- lArguments[ 1 ].Name = TKGet( TK_StatusDispatcher );
- lArguments[ 1 ].Value <<= mrOptimizerDialog.GetStatusDispatcher();
- lArguments[ 2 ].Name = TKGet( TK_InformationDialog );
- lArguments[ 2 ].Value <<= mrOptimizerDialog.GetFrame();
+ lArguments[ 0 ].Value <<= GetConfigurationSequence();
+ lArguments[ 1 ].Name = TKGet( TK_StatusListener );
+ lArguments[ 1 ].Value <<= Reference< XStatusListener >( this );
+ lArguments[ 2 ].Name = TKGet( TK_ParentWindow );
+ lArguments[ 2 ].Value <<= mxDialogWindowPeer;
if( xDispatch.is() )
xDispatch->dispatch( aURL, lArguments );
- mrOptimizerDialog.endExecute( bSuccessfullyExecuted );
+ endExecute( bSuccessfullyExecuted );
}
else
{
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_True ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_True ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_True ) );
- mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_True ) );
- mrOptimizerDialog.EnablePage( ITEM_ID_SUMMARY );
+ setControlProperty( TKGet( TK_btnNavHelp ), TKGet( TK_Enabled ), Any( sal_True ) );
+ setControlProperty( TKGet( TK_btnNavBack ), TKGet( TK_Enabled ), Any( sal_True ) );
+ setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_Enabled ), Any( sal_False ) );
+ setControlProperty( TKGet( TK_btnNavFinish ), TKGet( TK_Enabled ), Any( sal_True ) );
+ setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_True ) );
+ EnablePage( ITEM_ID_SUMMARY );
}
}
break;
- case TK_btnNavCancel : mrOptimizerDialog.endExecute( sal_False ); break;
+ case TK_btnNavCancel : endExecute( sal_False ); break;
case TK_Button0Pg0 : // delete configuration
{
- OUString aSelectedItem( mrOptimizerDialog.GetSelectedString( TK_ListBox0Pg0 ) );
+ OUString aSelectedItem( GetSelectedString( TK_ListBox0Pg0 ) );
if ( aSelectedItem.getLength() )
{
- std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( aSelectedItem ) );
- std::vector< OptimizerSettings >& rList( mrOptimizerDialog.GetOptimizerSettings() );
+ std::vector< OptimizerSettings >::iterator aIter( GetOptimizerSettingsByName( aSelectedItem ) );
+ std::vector< OptimizerSettings >& rList( GetOptimizerSettings() );
if ( aIter != rList.end() )
{
rList.erase( aIter );
- mrOptimizerDialog.UpdateControlStates();
+ UpdateControlStates();
}
}
}
break;
- default: break;
+ default:
+ {
+ Reference< XControl > xControl( rEvent.Source, UNO_QUERY );
+ if ( xControl.is() )
+ {
+ OUString aName;
+ Reference< XPropertySet > xProps( xControl->getModel(), UNO_QUERY );
+ xProps->getPropertyValue( TKGet( TK_Name ) ) >>= aName;
+ if ( TKGet( aName ) == TK_ListBox0Pg0 )
+ {
+ if ( rEvent.ActionCommand.getLength() )
+ {
+ std::vector< OptimizerSettings >::iterator aIter( GetOptimizerSettingsByName( rEvent.ActionCommand ) );
+ std::vector< OptimizerSettings >& rList( GetOptimizerSettings() );
+ if ( aIter != rList.end() )
+ rList[ 0 ] = *aIter;
+ }
+ UpdateControlStates();
+ }
+ }
+ }
+ break;
}
}
-void ActionListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
// -----------------------------------------------------------------------------
-void ActionListenerListBox0Pg0::actionPerformed( const ActionEvent& rEvent )
+void OptimizerDialog::textChanged( const TextEvent& rEvent )
throw ( com::sun::star::uno::RuntimeException )
{
- if ( rEvent.ActionCommand.getLength() )
+ Reference< XSpinField > xFormattedField( rEvent.Source, UNO_QUERY );
+ if ( xFormattedField.is() )
{
- std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( rEvent.ActionCommand ) );
- std::vector< OptimizerSettings >& rList( mrOptimizerDialog.GetOptimizerSettings() );
- if ( aIter != rList.end() )
- rList[ 0 ] = *aIter;
+ double fDouble = 0;
+ Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
+ if ( aAny >>= fDouble )
+ SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
+ return;
}
- mrOptimizerDialog.UpdateControlStates();
-}
-void ActionListenerListBox0Pg0::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void TextListenerFormattedField0Pg1::textChanged( const TextEvent& /* rEvent */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
- double fDouble = 0;
- Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
- if ( aAny >>= fDouble )
- mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
-}
-void TextListenerFormattedField0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
-
-// -----------------------------------------------------------------------------
-void TextListenerComboBox0Pg1::textChanged( const TextEvent& /* rEvent */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
- rtl::OUString aString;
- Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_ComboBox0Pg1 ), TKGet( TK_Text ) );
- if ( aAny >>= aString )
+ Reference< XComboBox > xComboBox( rEvent.Source, UNO_QUERY );
+ if ( xComboBox.is() )
{
- sal_Int32 nI0, nI1, nI2, nI3, nI4;
- nI0 = nI1 = nI2 = nI3 = nI4 = 0;
-
- if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';', nI0 ) == aString )
- aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_0 ).getToken( 0, ';', nI4 );
- else if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';', nI1 ) == aString )
- aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_1 ).getToken( 0, ';', nI4 );
- else if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';', nI2 ) == aString )
- aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_2 ).getToken( 0, ';', nI4 );
- else if ( mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 ) == aString )
- aString = mrOptimizerDialog.getString( STR_IMAGE_RESOLUTION_3 ).getToken( 0, ';', nI4 );
-
- mrOptimizerDialog.SetConfigProperty( TK_ImageResolution, Any( aString.toInt32() ) );
+ rtl::OUString aString;
+ Any aAny = getControlProperty( TKGet( TK_ComboBox0Pg1 ), TKGet( TK_Text ) );
+ if ( aAny >>= aString )
+ {
+ sal_Int32 nI0, nI1, nI2, nI3, nI4;
+ nI0 = nI1 = nI2 = nI3 = nI4 = 0;
+
+ if ( getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';', nI0 ) == aString )
+ aString = getString( STR_IMAGE_RESOLUTION_0 ).getToken( 0, ';', nI4 );
+ else if ( getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';', nI1 ) == aString )
+ aString = getString( STR_IMAGE_RESOLUTION_1 ).getToken( 0, ';', nI4 );
+ else if ( getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';', nI2 ) == aString )
+ aString = getString( STR_IMAGE_RESOLUTION_2 ).getToken( 0, ';', nI4 );
+ else if ( getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 ) == aString )
+ aString = getString( STR_IMAGE_RESOLUTION_3 ).getToken( 0, ';', nI4 );
+
+ SetConfigProperty( TK_ImageResolution, Any( aString.toInt32() ) );
+ }
}
}
-void TextListenerComboBox0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
// -----------------------------------------------------------------------------
-void SpinListenerFormattedField0Pg1::up( const SpinEvent& /* rEvent */ )
+void OptimizerDialog::up( const SpinEvent& /* rEvent */ )
throw ( com::sun::star::uno::RuntimeException )
{
double fDouble;
- Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
+ Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
if ( aAny >>= fDouble )
{
fDouble += 9;
if ( fDouble > 100 )
fDouble = 100;
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
- mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
+ setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
+ SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
}
}
-void SpinListenerFormattedField0Pg1::down( const SpinEvent& /* rEvent */ )
+
+void OptimizerDialog::down( const SpinEvent& /* rEvent */ )
throw ( com::sun::star::uno::RuntimeException )
{
double fDouble;
- Any aAny = mrOptimizerDialog.getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
+ Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
if ( aAny >>= fDouble )
{
fDouble -= 9;
if ( fDouble < 0 )
fDouble = 0;
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
- mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
+ setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
+ SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
}
}
-void SpinListenerFormattedField0Pg1::first( const SpinEvent& /* rEvent */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 0 ) ) );
- mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)0 ) );
-}
-void SpinListenerFormattedField0Pg1::last( const SpinEvent& /* rEvent */ )
+
+void OptimizerDialog::first( const SpinEvent& /* rEvent */ )
throw ( com::sun::star::uno::RuntimeException )
{
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 100 ) ) );
- mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)100 ) );
+ setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 0 ) ) );
+ SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)0 ) );
}
-void SpinListenerFormattedField0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
+
+void OptimizerDialog::last( const SpinEvent& /* rEvent */ )
throw ( com::sun::star::uno::RuntimeException )
{
+ setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 100 ) ) );
+ SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)100 ) );
}
-// -----------------------------------------------------------------------------
-
-void HelpCloseListener::addCloseListener( const Reference < XCloseListener >& ) throw( RuntimeException )
-{
-}
-void HelpCloseListener::removeCloseListener( const Reference < XCloseListener >& ) throw( RuntimeException )
-{
-}
-void HelpCloseListener::queryClosing( const EventObject&, sal_Bool /* bDeliverOwnership */ )
- throw ( RuntimeException, CloseVetoException )
-{
-}
-void HelpCloseListener::notifyClosing( const EventObject& )
- throw ( RuntimeException )
-{
-}
-void HelpCloseListener::disposing( const EventObject& ) throw ( RuntimeException )
-{
- mrXFrame = NULL;
-}
diff --git a/sdext/source/minimizer/optimizerdialog.hxx b/sdext/source/minimizer/optimizerdialog.hxx
index 3bd7870779bc..b05ba858db7e 100644
--- a/sdext/source/minimizer/optimizerdialog.hxx
+++ b/sdext/source/minimizer/optimizerdialog.hxx
@@ -51,6 +51,8 @@
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
#include <com/sun/star/awt/PushButtonType.hpp>
+#include <cppuhelper/implbase5.hxx>
+#include <cppuhelper/implbase1.hxx>
#define MAX_STEP 4
#define OD_DIALOG_WIDTH 330
@@ -66,36 +68,47 @@
// -------------------
// - OPTIMIZERDIALOG -
// -------------------
-class OptimizerDialog : public UnoDialog, public ConfigurationAccess
+
+typedef ::cppu::WeakImplHelper5<
+ com::sun::star::frame::XStatusListener,
+ com::sun::star::awt::XSpinListener,
+ com::sun::star::awt::XItemListener,
+ com::sun::star::awt::XActionListener,
+ com::sun::star::awt::XTextListener > OptimizerDialog_Base;
+
+class OptimizerDialog : public UnoDialog, public ConfigurationAccess, public OptimizerDialog_Base
{
public :
- OptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame,
- com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > rxStatusDispatcher );
+ OptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& xFrame,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent );
~OptimizerDialog();
+ virtual void SAL_CALL statusChanged( const ::com::sun::star::frame::FeatureStateEvent& aState ) throw (::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& aSource ) throw (::com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL up( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL down( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL first( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL last( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
+
sal_Bool execute();
+private :
+ com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
sal_Int16 mnCurrentStep;
sal_Int16 mnTabIndex;
sal_Bool mbIsReadonly;
-
-private :
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >mxMSF;
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
-
+ com::sun::star::uno::Reference< com::sun::star::frame::XModel > mxModel;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxRoadmapControl;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxRoadmapControlModel;
- com::sun::star::uno::Reference< com::sun::star::awt::XItemListener > mxItemListener;
- com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListener;
- com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > mxActionListenerListBox0Pg0;
- com::sun::star::uno::Reference< com::sun::star::awt::XTextListener > mxTextListenerFormattedField0Pg1;
- com::sun::star::uno::Reference< com::sun::star::awt::XTextListener > mxTextListenerComboBox0Pg1;
- com::sun::star::uno::Reference< com::sun::star::awt::XSpinListener > mxSpinListenerFormattedField0Pg1;
- com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > mxStatusDispatcher;
-
std::vector< std::vector< rtl::OUString > > maControlPages;
+ OptimizationStats maStats;
void InitDialog();
void InitRoadmap();
@@ -113,133 +126,90 @@ private :
void ActivatePage( sal_Int16 nStep );
void DeactivatePage( sal_Int16 nStep );
- void InsertRoadmapItem( const sal_Int32 nIndex, const sal_Bool bEnabled, const rtl::OUString& rLabel, const sal_Int32 nItemID );
-
-public :
-
- OptimizationStats maStats;
-
- void UpdateStatus( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rStatus );
-
- // the ConfigurationAccess is updated to actual control settings
- void UpdateConfiguration();
-
void EnablePage( sal_Int16 nStep );
void DisablePage( sal_Int16 nStep );
-
void SwitchPage( sal_Int16 nNewStep );
+
+ // the ConfigurationAccess is updated to actual control settings
+ void UpdateConfiguration();
+ void UpdateStatus( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& rStatus );
void UpdateControlStates( sal_Int16 nStep = -1 );
rtl::OUString GetSelectedString( PPPOptimizerTokenEnum eListBox );
- com::sun::star::uno::Reference< com::sun::star::frame::XDispatch >& GetStatusDispatcher() { return mxStatusDispatcher; };
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame>& GetFrame() { return mxFrame; };
- const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& GetComponentContext() { return mxMSF; };
+ void ImplSetBold( const rtl::OUString& rControl );
+ void InsertRoadmapItem( const sal_Int32 nIndex,
+ const sal_Bool bEnabled,
+ const rtl::OUString& rLabel,
+ const sal_Int32 nItemID );
+ rtl::OUString ImplInsertSeparator( const rtl::OUString& rControlName,
+ sal_Int32 nOrientation,
+ sal_Int32 nPosX,
+ sal_Int32 nPosY,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight );
+ rtl::OUString ImplInsertButton( const rtl::OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex,
+ sal_Bool bEnabled,
+ sal_Int32 nResID,
+ sal_Int16 nPushButtonType );
+ rtl::OUString ImplInsertFixedText( const rtl::OUString& rControlName,
+ const rtl::OUString& rLabel,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bMultiLine,
+ sal_Bool bBold,
+ sal_Int16 nTabIndex );
+ rtl::OUString ImplInsertCheckBox( const rtl::OUString& rControlName,
+ const rtl::OUString& rLabel,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex );
+ rtl::OUString ImplInsertFormattedField( const rtl::OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ double fEffectiveMin,
+ double fEffectiveMax,
+ sal_Int16 nTabIndex );
+ rtl::OUString ImplInsertComboBox( const rtl::OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ const sal_Bool bEnabled,
+ const com::sun::star::uno::Sequence< rtl::OUString >& rItemList,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex,
+ bool bListen = true );
+ rtl::OUString ImplInsertRadioButton( const rtl::OUString& rControlName,
+ const rtl::OUString& rLabel,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bMultiLine,
+ sal_Int16 nTabIndex );
+ rtl::OUString ImplInsertListBox( const rtl::OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ const sal_Bool bEnabled,
+ const com::sun::star::uno::Sequence< rtl::OUString >& rItemList,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex );
};
-// -----------------------------------------------------------------------------
-
-class ItemListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XItemListener >
-{
-public:
- ItemListener( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){};
-
- virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
-
- OptimizerDialog& mrOptimizerDialog;
-};
-
-// -----------------------------------------------------------------------------
-
-class ActionListener : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener >
-{
-public:
- ActionListener( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){};
-
- virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
-
- OptimizerDialog& mrOptimizerDialog;
-};
-
-// -----------------------------------------------------------------------------
-
-class ActionListenerListBox0Pg0 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XActionListener >
-{
-public:
- ActionListenerListBox0Pg0( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){};
-
- virtual void SAL_CALL actionPerformed( const ::com::sun::star::awt::ActionEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
-
- OptimizerDialog& mrOptimizerDialog;
-};
-
-// -----------------------------------------------------------------------------
-
-class TextListenerFormattedField0Pg1 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XTextListener >
-{
-public:
- TextListenerFormattedField0Pg1( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){};
-
- virtual void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
-
- OptimizerDialog& mrOptimizerDialog;
-};
-
-// -----------------------------------------------------------------------------
-
-class TextListenerComboBox0Pg1 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XTextListener >
-{
-public:
- TextListenerComboBox0Pg1( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){};
-
- virtual void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
-
- OptimizerDialog& mrOptimizerDialog;
-};
-
-// -----------------------------------------------------------------------------
-
-class SpinListenerFormattedField0Pg1 : public ::cppu::WeakImplHelper1< com::sun::star::awt::XSpinListener >
-{
-public:
- SpinListenerFormattedField0Pg1( OptimizerDialog& rOptimizerDialog ) : mrOptimizerDialog( rOptimizerDialog ){};
-
- virtual void SAL_CALL up( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL down( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL first( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL last( const ::com::sun::star::awt::SpinEvent& Event ) throw ( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw ( com::sun::star::uno::RuntimeException);
-private:
-
- OptimizerDialog& mrOptimizerDialog;
-};
-
-// -----------------------------------------------------------------------------
-
-class HelpCloseListener : public ::cppu::WeakImplHelper1< com::sun::star::util::XCloseListener >
-{
-public:
- HelpCloseListener( com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rXFrame ) : mrXFrame( rXFrame ){};
-
- virtual void SAL_CALL addCloseListener(const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& ) throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removeCloseListener( const com::sun::star::uno::Reference < com::sun::star::util::XCloseListener >& xListener ) throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL notifyClosing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException) ;
- virtual void SAL_CALL queryClosing( const com::sun::star::lang::EventObject& aEvent, sal_Bool bDeliverOwnership ) throw (com::sun::star::uno::RuntimeException, com::sun::star::util::CloseVetoException) ;
- virtual void SAL_CALL disposing( const com::sun::star::lang::EventObject& aEvent ) throw (com::sun::star::uno::RuntimeException) ;
-
-private:
-
- com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& mrXFrame;
-};
-
-
#endif // OPTIMIZERDIALOG_HXX
diff --git a/sdext/source/minimizer/optimizerdialogcontrols.cxx b/sdext/source/minimizer/optimizerdialogcontrols.cxx
index ffc9221cb62d..f4f820dbc62a 100644
--- a/sdext/source/minimizer/optimizerdialogcontrols.cxx
+++ b/sdext/source/minimizer/optimizerdialogcontrols.cxx
@@ -25,6 +25,8 @@
#include "precompiled_sdext.hxx"
#include "optimizerdialog.hxx"
+#include "minimizer.hrc"
+#include "helpid.hrc"
// -------------------
// - OptimizerDialog -
@@ -41,7 +43,6 @@
#endif
#include <rtl/ustrbuf.hxx>
-using namespace ::rtl;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
@@ -53,22 +54,29 @@ using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::presentation;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
// -----------------------------------------------------------------------------
-void SetBold( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControl )
+void OptimizerDialog::ImplSetBold( const rtl::OUString& rControl )
{
FontDescriptor aFontDescriptor;
- if ( rOptimizerDialog.getControlProperty( rControl, TKGet( TK_FontDescriptor ) ) >>= aFontDescriptor )
+ if ( getControlProperty( rControl, TKGet( TK_FontDescriptor ) ) >>= aFontDescriptor )
{
aFontDescriptor.Weight = FontWeight::BOLD;
- rOptimizerDialog.setControlProperty( rControl, TKGet( TK_FontDescriptor ), Any( aFontDescriptor ) );
+ setControlProperty( rControl, TKGet( TK_FontDescriptor ), Any( aFontDescriptor ) );
}
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, sal_Int32 nOrientation,
- sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight )
+rtl::OUString OptimizerDialog::ImplInsertSeparator(
+ const OUString& rControlName,
+ sal_Int32 nOrientation,
+ sal_Int32 nPosX,
+ sal_Int32 nPosY,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight )
{
OUString pNames[] = {
TKGet( TK_Height ),
@@ -91,19 +99,29 @@ rtl::OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- rOptimizerDialog.insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ),
+ insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ),
rControlName, aNames, aValues );
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, Reference< XActionListener >& xActionListener,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex, sal_Bool bEnabled, PPPOptimizerTokenEnum nResID, sal_Int16 nPushButtonType )
+rtl::OUString OptimizerDialog::ImplInsertButton(
+ const OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex,
+ sal_Bool bEnabled,
+ sal_Int32 nResID,
+ sal_Int16 nPushButtonType )
{
OUString pNames[] = {
TKGet( TK_Enabled ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -115,7 +133,8 @@ rtl::OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& r
Any pValues[] = {
Any( bEnabled ),
Any( nHeight ),
- Any( rOptimizerDialog.getString( nResID ) ),
+ Any( rHelpURL ),
+ Any( getString( nResID ) ),
Any( nXPos ),
Any( nYPos ),
Any( nPushButtonType ),
@@ -129,14 +148,22 @@ rtl::OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& r
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- rOptimizerDialog.insertButton( rControlName, xActionListener, aNames, aValues );
+ insertButton( rControlName, this, aNames, aValues );
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControlName, const OUString& rLabel,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Bool bBold, sal_Int16 nTabIndex )
+rtl::OUString OptimizerDialog::ImplInsertFixedText(
+ const rtl::OUString& rControlName,
+ const OUString& rLabel,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bMultiLine,
+ sal_Bool bBold,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_Height ),
@@ -163,21 +190,28 @@ rtl::OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const rtl::OUS
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- rOptimizerDialog.insertFixedText( rControlName, aNames, aValues );
+ insertFixedText( rControlName, aNames, aValues );
if ( bBold )
- SetBold( rOptimizerDialog, rControlName );
+ ImplSetBold( rControlName );
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
- const Reference< XItemListener > xItemListener, const OUString& rLabel,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex )
+rtl::OUString OptimizerDialog::ImplInsertCheckBox(
+ const OUString& rControlName,
+ const OUString& rLabel,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_Enabled ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -188,6 +222,7 @@ rtl::OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString&
Any pValues[] = {
Any( sal_True ),
Any( nHeight ),
+ Any( rHelpURL ),
Any( rLabel ),
Any( nXPos ),
Any( nYPos ),
@@ -200,23 +235,29 @@ rtl::OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString&
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XCheckBox > xCheckBox( rOptimizerDialog.insertCheckBox( rControlName, aNames, aValues ) );
- if ( xItemListener.is() )
- xCheckBox->addItemListener( xItemListener );
+ Reference< XCheckBox > xCheckBox( insertCheckBox( rControlName, aNames, aValues ) );
+ xCheckBox->addItemListener( this );
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
- const Reference< XTextListener > xTextListener, const Reference< XSpinListener > xSpinListener, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth,
- double fEffectiveMin, double fEffectiveMax, sal_Int16 nTabIndex )
+rtl::OUString OptimizerDialog::ImplInsertFormattedField(
+ const OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ double fEffectiveMin,
+ double fEffectiveMax,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_EffectiveMax ),
TKGet( TK_EffectiveMin ),
TKGet( TK_Enabled ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
TKGet( TK_Repeat ),
@@ -230,6 +271,7 @@ rtl::OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUS
Any( fEffectiveMin ),
Any( sal_True ),
Any( (sal_Int32)12 ),
+ Any( rHelpURL ),
Any( nXPos ),
Any( nYPos ),
Any( (sal_Bool)sal_True ),
@@ -243,27 +285,33 @@ rtl::OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUS
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertFormattedField( rControlName, aNames, aValues ), UNO_QUERY_THROW );
- if ( xTextListener.is() )
- xTextComponent->addTextListener( xTextListener );
- if ( xSpinListener.is() )
- {
- Reference< XSpinField > xSpinField( xTextComponent, UNO_QUERY_THROW );
- xSpinField->addSpinListener( xSpinListener );
- }
+ Reference< XTextComponent > xTextComponent( insertFormattedField( rControlName, aNames, aValues ), UNO_QUERY_THROW );
+ xTextComponent->addTextListener( this );
+ Reference< XSpinField > xSpinField( xTextComponent, UNO_QUERY_THROW );
+ xSpinField->addSpinListener( this );
+
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
- const Reference< XTextListener > xTextListener, const sal_Bool bEnabled, const Sequence< OUString >& rItemList,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex )
+rtl::OUString OptimizerDialog::ImplInsertComboBox(
+ const OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ const sal_Bool bEnabled,
+ const Sequence< OUString >& rItemList,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex,
+ bool bListen )
{
OUString pNames[] = {
TKGet( TK_Dropdown ),
TKGet( TK_Enabled ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_LineCount ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -276,6 +324,7 @@ rtl::OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString&
Any( sal_True ),
Any( bEnabled ),
Any( nHeight ),
+ Any( rHelpURL ),
Any( (sal_Int16)8),
Any( nXPos ),
Any( nYPos ),
@@ -289,19 +338,28 @@ rtl::OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString&
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW );
- if ( xTextListener.is() )
- xTextComponent->addTextListener( xTextListener );
+ Reference< XTextComponent > xTextComponent( insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW );
+ if ( bListen )
+ xTextComponent->addTextListener( this );
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControlName, const Reference< XItemListener > xItemListener,
- const OUString& rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Bool bMultiLine, sal_Int16 nTabIndex )
+rtl::OUString OptimizerDialog::ImplInsertRadioButton(
+ const rtl::OUString& rControlName,
+ const OUString& rLabel,
+ const rtl::OUString& rHelpURL,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Bool bMultiLine,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_MultiLine ),
TKGet( TK_PositionX ),
@@ -312,6 +370,7 @@ rtl::OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const rtl::O
Any pValues[] = {
Any( nHeight ),
+ Any( rHelpURL ),
Any( rLabel ),
Any( bMultiLine ),
Any( nXPos ),
@@ -325,22 +384,29 @@ rtl::OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const rtl::O
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XRadioButton > xRadioButton( rOptimizerDialog.insertRadioButton( rControlName, aNames, aValues ) );
- if ( xItemListener.is() )
- xRadioButton->addItemListener( xItemListener );
+ Reference< XRadioButton > xRadioButton( insertRadioButton( rControlName, aNames, aValues ) );
+ xRadioButton->addItemListener( this );
return rControlName;
}
// -----------------------------------------------------------------------------
-rtl::OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
- const Reference< XActionListener > xActionListener, const sal_Bool bEnabled, const Sequence< OUString >& rItemList,
- sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, sal_Int16 nTabIndex )
+rtl::OUString OptimizerDialog::ImplInsertListBox(
+ const OUString& rControlName,
+ const rtl::OUString& rHelpURL,
+ const sal_Bool bEnabled,
+ const Sequence< OUString >& rItemList,
+ sal_Int32 nXPos,
+ sal_Int32 nYPos,
+ sal_Int32 nWidth,
+ sal_Int32 nHeight,
+ sal_Int16 nTabIndex )
{
OUString pNames[] = {
TKGet( TK_Dropdown ),
TKGet( TK_Enabled ),
TKGet( TK_Height ),
+ TKGet( TK_HelpURL ),
TKGet( TK_LineCount ),
TKGet( TK_MultiSelection ),
TKGet( TK_PositionX ),
@@ -354,6 +420,7 @@ rtl::OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString&
Any( sal_True ),
Any( bEnabled ),
Any( nHeight ),
+ Any( rHelpURL ),
Any( (sal_Int16)8),
Any( sal_False ),
Any( nXPos ),
@@ -368,9 +435,8 @@ rtl::OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString&
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XListBox > xListBox( rOptimizerDialog.insertListBox( rControlName, aNames, aValues ) );
- if ( xListBox.is() )
- xListBox->addActionListener( xActionListener );
+ Reference< XListBox > xListBox( insertListBox( rControlName, aNames, aValues ) );
+ xListBox->addActionListener( this );
return rControlName;
}
@@ -383,14 +449,14 @@ void OptimizerDialog::InitNavigationBar()
sal_Int32 nNextPosX = nFinishPosX - 6 - BUTTON_WIDTH;
sal_Int32 nBackPosX = nNextPosX - 3 - BUTTON_WIDTH;
- InsertSeparator( *this, TKGet( TK_lnNavSep1 ), 0, 0, DIALOG_HEIGHT - 26, OD_DIALOG_WIDTH, 1 );
- InsertSeparator( *this, TKGet( TK_lnNavSep2 ), 1, 85, 0, 1, BUTTON_POS_Y - 6 );
+ ImplInsertSeparator( TKGet( TK_lnNavSep1 ), 0, 0, DIALOG_HEIGHT - 26, OD_DIALOG_WIDTH, 1 );
+ ImplInsertSeparator( TKGet( TK_lnNavSep2 ), 1, 85, 0, 1, BUTTON_POS_Y - 6 );
- InsertButton( *this, TKGet( TK_btnNavHelp ), mxActionListener, 8, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_HELP, PushButtonType_STANDARD );
- InsertButton( *this, TKGet( TK_btnNavBack ), mxActionListener, nBackPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_False, STR_BACK, PushButtonType_STANDARD );
- InsertButton( *this, TKGet( TK_btnNavNext ), mxActionListener, nNextPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_NEXT, PushButtonType_STANDARD );
- InsertButton( *this, TKGet( TK_btnNavFinish ), mxActionListener, nFinishPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_FINISH, PushButtonType_STANDARD );
- InsertButton( *this, TKGet( TK_btnNavCancel ), mxActionListener, nCancelPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_CANCEL, PushButtonType_STANDARD );
+ ImplInsertButton( TKGet( TK_btnNavHelp ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_HELP ), 8, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_HELP, PushButtonType_HELP );
+ ImplInsertButton( TKGet( TK_btnNavBack ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_BACK ), nBackPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_False, STR_BACK, PushButtonType_STANDARD );
+ ImplInsertButton( TKGet( TK_btnNavNext ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_NEXT ), nNextPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_NEXT, PushButtonType_STANDARD );
+ ImplInsertButton( TKGet( TK_btnNavFinish ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_FINISH ), nFinishPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_FINISH, PushButtonType_STANDARD );
+ ImplInsertButton( TKGet( TK_btnNavCancel ), HID( HID_SDEXT_MINIMIZER_WIZ_PB_CANCEL ), nCancelPosX, BUTTON_POS_Y, BUTTON_WIDTH, BUTTON_HEIGHT, mnTabIndex++, sal_True, STR_CANCEL, PushButtonType_STANDARD );
setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_DefaultButton ), Any( sal_True ) );
}
@@ -433,12 +499,12 @@ void OptimizerDialog::InitPage0()
{
Sequence< OUString > aItemList;
std::vector< rtl::OUString > aControlList;
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg0 ), getString( STR_INTRODUCTION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg0 ), getString( STR_INTRODUCTION_T ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 100, sal_True, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertSeparator( *this, TKGet( TK_Separator1Pg0 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 66, PAGE_WIDTH - 12, 1 ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText2Pg0 ), getString( STR_CHOSE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 60, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertListBox( *this, TKGet( TK_ListBox0Pg0 ), mxActionListenerListBox0Pg0, sal_True, aItemList, PAGE_POS_X + 6, DIALOG_HEIGHT - 48, ( OD_DIALOG_WIDTH - 50 ) - ( PAGE_POS_X + 6 ), 12, mnTabIndex++ ) );
- aControlList.push_back( InsertButton( *this, TKGet( TK_Button0Pg0 ), mxActionListener, OD_DIALOG_WIDTH - 46, DIALOG_HEIGHT - 49, 40, 14, mnTabIndex++, sal_True, STR_REMOVE, PushButtonType_STANDARD ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg0 ), getString( STR_INTRODUCTION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg0 ), getString( STR_INTRODUCTION_T ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 100, sal_True, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertSeparator( TKGet( TK_Separator1Pg0 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 66, PAGE_WIDTH - 12, 1 ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText2Pg0 ), getString( STR_CHOSE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 60, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertListBox( TKGet( TK_ListBox0Pg0 ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP1_LB_SETTINGS),sal_True, aItemList, PAGE_POS_X + 6, DIALOG_HEIGHT - 48, ( OD_DIALOG_WIDTH - 50 ) - ( PAGE_POS_X + 6 ), 12, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertButton( TKGet( TK_Button0Pg0 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP1_PB_DELSETTS ),OD_DIALOG_WIDTH - 46, DIALOG_HEIGHT - 49, 40, 14, mnTabIndex++, sal_True, STR_REMOVE, PushButtonType_STANDARD ) );
maControlPages.push_back( aControlList );
DeactivatePage( 0 );
UpdateControlStatesPage0();
@@ -459,7 +525,7 @@ void OptimizerDialog::UpdateControlStatesPage1()
void OptimizerDialog::InitPage1()
{
Sequence< OUString > aCustomShowList;
- Reference< XModel > xModel( mxController->getModel() );
+ Reference< XModel > xModel( mxModel );
if ( xModel.is() )
{
Reference< XCustomPresentationSupplier > aXCPSup( xModel, UNO_QUERY_THROW );
@@ -468,12 +534,12 @@ void OptimizerDialog::InitPage1()
aCustomShowList = aXCont->getElementNames();
}
std::vector< rtl::OUString > aControlList;
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg3 ), getString( STR_CHOOSE_SLIDES ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox0Pg3 ), mxItemListener, getString( STR_DELETE_MASTER_PAGES ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox2Pg3 ), mxItemListener, getString( STR_DELETE_HIDDEN_SLIDES ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox3Pg3 ), mxItemListener, getString( STR_CUSTOM_SHOW ), PAGE_POS_X + 6, PAGE_POS_Y + 42, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
- aControlList.push_back( InsertListBox( *this, TKGet( TK_ListBox0Pg3 ), mxActionListener, sal_True, aCustomShowList, PAGE_POS_X + 14, PAGE_POS_Y + 54, 150, 12, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox1Pg3 ), mxItemListener, getString( STR_DELETE_NOTES_PAGES ), PAGE_POS_X + 6, PAGE_POS_Y + 70, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg3 ), getString( STR_CHOOSE_SLIDES ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox0Pg3 ), getString( STR_DELETE_MASTER_PAGES ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_MASTERPAGES ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox2Pg3 ), getString( STR_DELETE_HIDDEN_SLIDES ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_HIDDENSLIDES ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox3Pg3 ), getString( STR_CUSTOM_SHOW ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_CUSTOMSHOW ), PAGE_POS_X + 6, PAGE_POS_Y + 42, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertListBox( TKGet( TK_ListBox0Pg3 ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP2_LB_CUSTOMSHOW),sal_True, aCustomShowList, PAGE_POS_X + 14, PAGE_POS_Y + 54, 150, 12, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox1Pg3 ), getString( STR_DELETE_NOTES_PAGES ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP2_CB_NOTES ), PAGE_POS_X + 6, PAGE_POS_Y + 70, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 1 );
@@ -535,15 +601,15 @@ void OptimizerDialog::InitPage2()
aResolutionItemList[ 3 ] = getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 );
std::vector< rtl::OUString > aControlList;
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg1 ), getString( STR_GRAPHIC_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
- aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton0Pg1 ), mxItemListener, getString( STR_LOSSLESS_COMPRESSION ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton1Pg1 ), mxItemListener, getString( STR_JPEG_COMPRESSION ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg1 ), getString( STR_QUALITY ), PAGE_POS_X + 20, PAGE_POS_Y + 40, 72, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFormattedField( *this, TKGet( TK_FormattedField0Pg1 ), mxTextListenerFormattedField0Pg1, mxSpinListenerFormattedField0Pg1, PAGE_POS_X + 106, PAGE_POS_Y + 38, 50, 0, 100, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText2Pg1 ), getString( STR_IMAGE_RESOLUTION ), PAGE_POS_X + 6, PAGE_POS_Y + 54, 94, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertComboBox( *this, TKGet( TK_ComboBox0Pg1 ), mxTextListenerComboBox0Pg1, sal_True, aResolutionItemList, PAGE_POS_X + 106, PAGE_POS_Y + 52, 100, 12, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox1Pg1 ), mxItemListener, getString( STR_REMOVE_CROP_AREA ), PAGE_POS_X + 6, PAGE_POS_Y + 68, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox2Pg1 ), mxItemListener, getString( STR_EMBED_LINKED_GRAPHICS ), PAGE_POS_X + 6, PAGE_POS_Y + 82, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg1 ), getString( STR_GRAPHIC_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton0Pg1 ), getString( STR_LOSSLESS_COMPRESSION ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_LOSSLESS ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton1Pg1 ), getString( STR_JPEG_COMPRESSION ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_RB_JPEG ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg1 ), getString( STR_QUALITY ), PAGE_POS_X + 20, PAGE_POS_Y + 40, 72, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFormattedField( TKGet( TK_FormattedField0Pg1 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_MF_QUALITY ), PAGE_POS_X + 106, PAGE_POS_Y + 38, 50, 0, 100, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText2Pg1 ), getString( STR_IMAGE_RESOLUTION ), PAGE_POS_X + 6, PAGE_POS_Y + 54, 94, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertComboBox( TKGet( TK_ComboBox0Pg1 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_LB_DPI ), sal_True, aResolutionItemList, PAGE_POS_X + 106, PAGE_POS_Y + 52, 100, 12, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox1Pg1 ), getString( STR_REMOVE_CROP_AREA ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_CROP ), PAGE_POS_X + 6, PAGE_POS_Y + 68, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox2Pg1 ), getString( STR_EMBED_LINKED_GRAPHICS ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP3_CB_LINKS ), PAGE_POS_X + 6, PAGE_POS_Y + 82, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 2 );
UpdateControlStatesPage2();
@@ -565,7 +631,7 @@ void OptimizerDialog::UpdateControlStatesPage3()
void OptimizerDialog::InitPage3()
{
int nOLECount = 0;
- Reference< XModel > xModel( mxController->getModel() );
+ Reference< XModel > xModel( mxModel );
Reference< XDrawPagesSupplier > xDrawPagesSupplier( xModel, UNO_QUERY_THROW );
Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
@@ -581,11 +647,11 @@ void OptimizerDialog::InitPage3()
}
std::vector< rtl::OUString > aControlList;
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg2 ), getString( STR_OLE_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox0Pg2 ), mxItemListener, getString( STR_OLE_REPLACE ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
- aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton0Pg2 ), mxItemListener, getString( STR_ALL_OLE_OBJECTS ), PAGE_POS_X + 14, PAGE_POS_Y + 28, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton1Pg2 ), mxItemListener, getString( STR_ALIEN_OLE_OBJECTS_ONLY ), PAGE_POS_X + 14, PAGE_POS_Y + 40, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg2 ), nOLECount ? getString( STR_OLE_OBJECTS_DESC ) : getString( STR_NO_OLE_OBJECTS_DESC ), PAGE_POS_X + 6, PAGE_POS_Y + 64, PAGE_WIDTH - 22, 50, sal_True, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg2 ), getString( STR_OLE_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox0Pg2 ), getString( STR_OLE_REPLACE ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP4_CB_OLE ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton0Pg2 ), getString( STR_ALL_OLE_OBJECTS ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_ALLOLE), PAGE_POS_X + 14, PAGE_POS_Y + 28, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton1Pg2 ), getString( STR_ALIEN_OLE_OBJECTS_ONLY ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP4_RB_NOTODF),PAGE_POS_X + 14, PAGE_POS_Y + 40, PAGE_WIDTH - 22, 8, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg2 ), nOLECount ? getString( STR_OLE_OBJECTS_DESC ) : getString( STR_NO_OLE_OBJECTS_DESC ), PAGE_POS_X + 6, PAGE_POS_Y + 64, PAGE_WIDTH - 22, 50, sal_True, sal_False, mnTabIndex++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 3 );
UpdateControlStatesPage3();
@@ -683,7 +749,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
if ( aCustomShowName.getLength() )
{
std::vector< Reference< XDrawPage > > vNonUsedPageList;
- PageCollector::CollectNonCustomShowPages( mxController->getModel(), aCustomShowName, vNonUsedPageList );
+ PageCollector::CollectNonCustomShowPages( mxModel, aCustomShowName, vNonUsedPageList );
nDeletedSlides += vNonUsedPageList.size();
}
if ( GetConfigProperty( TK_DeleteHiddenSlides, sal_False ) )
@@ -691,7 +757,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
if ( aCustomShowName.getLength() )
{
std::vector< Reference< XDrawPage > > vUsedPageList;
- PageCollector::CollectCustomShowPages( mxController->getModel(), aCustomShowName, vUsedPageList );
+ PageCollector::CollectCustomShowPages( mxModel, aCustomShowName, vUsedPageList );
std::vector< Reference< XDrawPage > >::iterator aIter( vUsedPageList.begin() );
while( aIter != vUsedPageList.end() )
{
@@ -708,7 +774,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
}
else
{
- Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
+ Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
for( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
{
@@ -728,8 +794,8 @@ void OptimizerDialog::UpdateControlStatesPage4()
if ( GetConfigProperty( TK_DeleteUnusedMasterPages, sal_False ) )
{
std::vector< PageCollector::MasterPageEntity > aMasterPageList;
- PageCollector::CollectMasterPages( mxController->getModel(), aMasterPageList );
- Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
+ PageCollector::CollectMasterPages( mxModel, aMasterPageList );
+ Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
std::vector< PageCollector::MasterPageEntity >::iterator aIter( aMasterPageList.begin() );
while( aIter != aMasterPageList.end() )
@@ -756,7 +822,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
sal_Int32 nImageResolution( GetConfigProperty( TK_ImageResolution, (sal_Int32)0 ) );
GraphicSettings aGraphicSettings( bJPEGCompression, nJPEGQuality, GetConfigProperty( TK_RemoveCropArea, sal_False ),
nImageResolution, GetConfigProperty( TK_EmbedLinkedGraphics, sal_True ) );
- GraphicCollector::CountGraphics( mxMSF, mxController->getModel(), aGraphicSettings, nGraphics );
+ GraphicCollector::CountGraphics( mxContext, mxModel, aGraphicSettings, nGraphics );
if ( nGraphics > 1 )
{
OUString aStr( getString( STR_OPTIMIZE_IMAGES ) );
@@ -781,7 +847,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
if ( GetConfigProperty( TK_OLEOptimization, sal_False ) )
{
sal_Int32 nOLEReplacements = 0;
- Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
+ Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxModel, UNO_QUERY_THROW );
Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
{
@@ -812,7 +878,7 @@ void OptimizerDialog::UpdateControlStatesPage4()
sal_Int64 nCurrentFileSize = 0;
sal_Int64 nEstimatedFileSize = 0;
- Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY );
+ Reference< XStorable > xStorable( mxModel, UNO_QUERY );
if ( xStorable.is() && xStorable->hasLocation() )
nCurrentFileSize = PPPOptimizer::GetFileSize( xStorable->getLocation() );
@@ -856,7 +922,7 @@ void OptimizerDialog::InitPage4()
Any pValues[] = {
Any( (sal_Int32)12 ),
- Any( TKGet( STR_SAVE_AS ) ),
+ Any( OUString( RTL_CONSTASCII_USTRINGPARAM("STR_SAVE_AS") ) ),//TODO
Any( (sal_Int32)( PAGE_POS_X + 6 ) ),
Any( (sal_Int32)( DIALOG_HEIGHT - 75 ) ),
Any( (sal_Int32)( 0 ) ),
@@ -872,30 +938,35 @@ void OptimizerDialog::InitPage4()
Reference< XMultiPropertySet > xMultiPropertySet( insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlProgressBarModel" ) ),
TKGet( TK_Progress ), aNames, aValues ), UNO_QUERY );
}
- Reference< XTextListener > xTextListener;
+
Sequence< OUString > aItemList;
std::vector< rtl::OUString > aControlList;
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText0Pg4 ), getString( STR_SUMMARY_TITLE ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
-// aControlList.push_back( InsertSeparator( *this, TKGet( TK_Separator0Pg4 ), 0, PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 1 ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText0Pg4 ), getString( STR_SUMMARY_TITLE ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, sal_False, sal_True, mnTabIndex++ ) );
+// aControlList.push_back( ImplInsertSeparator( TKGet( TK_Separator0Pg4 ), 0, PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 1 ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText4Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText5Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 22, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText6Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 30, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText4Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText5Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 22, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText6Pg4 ), OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 30, PAGE_WIDTH - 12, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText2Pg4 ), getString( STR_CURRENT_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 50, 88, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText7Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 50, 30, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText2Pg4 ), getString( STR_CURRENT_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 50, 88, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText7Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 50, 30, 8, sal_False, sal_False, mnTabIndex++ ) );
setControlProperty( TKGet( TK_FixedText7Pg4 ), TKGet( TK_Align ), Any( static_cast< short >( 2 ) ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText3Pg4 ), getString( STR_ESTIMATED_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 58, 88, 8, sal_False, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText8Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 58, 30, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText3Pg4 ), getString( STR_ESTIMATED_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 58, 88, 8, sal_False, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText8Pg4 ), OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 58, 30, 8, sal_False, sal_False, mnTabIndex++ ) );
setControlProperty( TKGet( TK_FixedText8Pg4 ), TKGet( TK_Align ), Any( static_cast< short >( 2 ) ) );
- aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton0Pg4 ), mxItemListener, getString( STR_APPLY_TO_CURRENT ), PAGE_POS_X + 6, PAGE_POS_Y + 78, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertRadioButton( *this, TKGet( TK_RadioButton1Pg4 ), mxItemListener, getString( STR_SAVE_AS ), PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
- aControlList.push_back( InsertFixedText( *this, TKGet( TK_FixedText1Pg4 ), OUString(), PAGE_POS_X + 6, DIALOG_HEIGHT - 87, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton0Pg4 ), getString( STR_APPLY_TO_CURRENT ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_CURDOC),PAGE_POS_X + 6, PAGE_POS_Y + 78, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertRadioButton( TKGet( TK_RadioButton1Pg4 ), getString( STR_SAVE_AS ), HID(HID_SDEXT_MINIMIZER_WIZ_STEP5_RB_NEWDOC),PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 8, sal_False, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertFixedText( TKGet( TK_FixedText1Pg4 ), OUString(), PAGE_POS_X + 6, DIALOG_HEIGHT - 87, PAGE_WIDTH - 12, 8, sal_True, sal_False, mnTabIndex++ ) );
aControlList.push_back( TKGet( TK_Progress ) );
- aControlList.push_back( InsertSeparator( *this, TKGet( TK_Separator1Pg4 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 58, PAGE_WIDTH - 12, 1 ) );
- aControlList.push_back( InsertCheckBox( *this, TKGet( TK_CheckBox1Pg4 ), mxItemListener, getString( STR_SAVE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 47, 100, 8, mnTabIndex++ ) );
- aControlList.push_back( InsertComboBox( *this, TKGet( TK_ComboBox0Pg4 ), xTextListener, sal_True, aItemList, PAGE_POS_X + 106, DIALOG_HEIGHT - 48, 100, 12, mnTabIndex++ ) );
+ aControlList.push_back( ImplInsertSeparator( TKGet( TK_Separator1Pg4 ), 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 58, PAGE_WIDTH - 12, 1 ) );
+ aControlList.push_back( ImplInsertCheckBox( TKGet( TK_CheckBox1Pg4 ), getString( STR_SAVE_SETTINGS ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP5_CB_SAVESETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 47, 100, 8, mnTabIndex++ ) );
+ // don't listen to this
+ aControlList.push_back(
+ ImplInsertComboBox(
+ TKGet( TK_ComboBox0Pg4 ), HID( HID_SDEXT_MINIMIZER_WIZ_STEP5_LB_SETTINGSNAME ),sal_True, aItemList,
+ PAGE_POS_X + 106, DIALOG_HEIGHT - 48, 100, 12, mnTabIndex++ ,
+ false) );
maControlPages.push_back( aControlList );
DeactivatePage( 4 );
diff --git a/sdext/source/minimizer/pagecollector.cxx b/sdext/source/minimizer/pagecollector.cxx
index 94fa5b21e1bf..e1a3d61cff5b 100644
--- a/sdext/source/minimizer/pagecollector.cxx
+++ b/sdext/source/minimizer/pagecollector.cxx
@@ -33,7 +33,6 @@
#include <com/sun/star/container/XNameContainer.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
-using namespace ::rtl;
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::awt;
@@ -43,6 +42,8 @@ using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::presentation;
+using ::rtl::OUString;
+
void PageCollector::CollectCustomShowPages( const com::sun::star::uno::Reference< com::sun::star::frame::XModel >& rxModel, const rtl::OUString& rCustomShowName, std::vector< Reference< XDrawPage > >& rUsedPageList )
{
try
diff --git a/sdext/source/minimizer/pppoptimizer.cxx b/sdext/source/minimizer/pppoptimizer.cxx
index aad91a2f7f18..191867594ef0 100644
--- a/sdext/source/minimizer/pppoptimizer.cxx
+++ b/sdext/source/minimizer/pppoptimizer.cxx
@@ -30,28 +30,32 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-using namespace ::rtl;
+#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer"
+
+
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;
-#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer"
+using ::rtl::OUString;
// ----------------
// - PPPOptimizer -
// ----------------
-PPPOptimizer::PPPOptimizer( const Reference< XComponentContext > &rxMSF ) :
- mxMSF( rxMSF )
+PPPOptimizer::PPPOptimizer( const Reference< XComponentContext > &rxContext ) :
+ mxContext( rxContext )
{
+ OSL_TRACE("PPPOptimizer::PPPOptimizer");
}
// -----------------------------------------------------------------------------
PPPOptimizer::~PPPOptimizer()
{
+ OSL_TRACE("PPPOptimizer::~PPPOptimizer");
}
// -----------------------------------------------------------------------------
@@ -61,6 +65,7 @@ PPPOptimizer::~PPPOptimizer()
void SAL_CALL PPPOptimizer::initialize( const Sequence< Any >& aArguments )
throw ( Exception, RuntimeException )
{
+ OSL_TRACE("PPPOptimizer::initialize");
if( aArguments.getLength() != 1 )
throw IllegalArgumentException();
@@ -130,6 +135,7 @@ Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizer:
void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyValue >& lArguments )
throw( RuntimeException )
{
+ OSL_TRACE("PPPOptimizer::dispatch");
if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.PPPOptimizer:" ) == 0 ) )
{
if ( rURL.Path.compareToAscii( "optimize" ) == 0 )
@@ -139,7 +145,7 @@ void SAL_CALL PPPOptimizer::dispatch( const URL& rURL, const Sequence< PropertyV
{
try
{
- ImpOptimizer aOptimizer( mxMSF, xModel );
+ ImpOptimizer aOptimizer( mxContext, xModel );
aOptimizer.Optimize( lArguments );
}
catch( Exception& )
diff --git a/sdext/source/minimizer/pppoptimizer.hxx b/sdext/source/minimizer/pppoptimizer.hxx
index e017b328b61d..018295c4a573 100644
--- a/sdext/source/minimizer/pppoptimizer.hxx
+++ b/sdext/source/minimizer/pppoptimizer.hxx
@@ -43,12 +43,12 @@ class PPPOptimizer : public cppu::WeakImplHelper4<
com::sun::star::frame::XDispatchProvider,
com::sun::star::frame::XDispatch >
{
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController;
public:
- PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF );
+ PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
virtual ~PPPOptimizer();
// XInitialization
diff --git a/sdext/source/minimizer/pppoptimizerdialog.cxx b/sdext/source/minimizer/pppoptimizerdialog.cxx
index 4afe12cd3257..dc50e6b87ab7 100644
--- a/sdext/source/minimizer/pppoptimizerdialog.cxx
+++ b/sdext/source/minimizer/pppoptimizerdialog.cxx
@@ -27,30 +27,40 @@
#include "pppoptimizerdialog.hxx"
#include "optimizerdialog.hxx"
-using namespace ::rtl;
+#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
+#include <rtl/strbuf.hxx>
+#include <rtl/ref.hxx>
+
+#define SERVICE_NAME "com.sun.star.ui.dialogs.PresentationMinimizerDialog"
+#define IMPLEMENTATION_NAME "com.sun.star.comp.ui.dialogs.PresentationMinimizerDialog"
+
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;
-#define SERVICE_NAME "com.sun.star.comp.SunPresentationMinimizer"
-#include <rtl/ustrbuf.hxx>
+using ::rtl::OUString;
+using ::com::sun::star::awt::XWindow;
+using ::com::sun::star::awt::XWindowPeer;
// ----------------------
// - PPPOptimizerDialog -
// ----------------------
-PPPOptimizerDialog::PPPOptimizerDialog( const Reference< XComponentContext > &rxMSF ) :
- mxMSF( rxMSF ),
- mpOptimizerDialog( NULL )
+PPPOptimizerDialog::PPPOptimizerDialog(
+ const Reference< XComponentContext > &rxContext )
+ : m_xContext( rxContext )
+ , mbInitialized( false )
{
+ OSL_TRACE("PPPOptimizerDialog::PPPOptimizerDialog");
}
// -----------------------------------------------------------------------------
PPPOptimizerDialog::~PPPOptimizerDialog()
{
+ OSL_TRACE("PPPOptimizerDialog::~PPPOptimizerDialog");
}
// -----------------------------------------------------------------------------
@@ -60,12 +70,60 @@ PPPOptimizerDialog::~PPPOptimizerDialog()
void SAL_CALL PPPOptimizerDialog::initialize( const Sequence< Any >& aArguments )
throw ( Exception, RuntimeException )
{
- if( aArguments.getLength() != 1 )
- throw IllegalArgumentException();
+ OSL_TRACE("PPPOptimizerDialog::initialize");
+ osl::ResettableMutexGuard aGuard( m_aMutex );
+ if ( mbInitialized )
+ throw RuntimeException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "PPPOptimizerDialog has already been initialized!") ),
+ Reference< XInterface >() );
+ aGuard.clear();
+
+ Reference< XFrame > xFrame;
+ Reference< XController > xController;
+ Reference< XModel > xModel;
+ Reference< XWindow > xWindow;
+
+ const Any *pAny = aArguments.getConstArray();
+ const Any *pEnd = pAny + aArguments.getLength();
+ for ( ; pAny != pEnd && !xFrame.is() && !xWindow.is(); pAny++ )
+ {
+ if ( ( *pAny >>= xFrame ) && xFrame.is() )
+ {
+ xWindow = xFrame->getContainerWindow();
+ }
+ else if ( ( *pAny >>= xController ) && xController.is() )
+ {
+ xFrame = xController->getFrame();
+ if ( xFrame.is() )
+ xWindow = xFrame->getContainerWindow();
+ }
+ else if ( ( *pAny >>= xModel ) && xModel.is() )
+ {
+ xController = xModel->getCurrentController();
+ if ( xController.is() )
+ {
+ xFrame = xController->getFrame();
+ if ( xFrame.is() )
+ xWindow = xFrame->getContainerWindow();
+ }
+ }
+ else
+ *pAny >>= xWindow;
+ }
- aArguments[ 0 ] >>= mxFrame;
- if ( mxFrame.is() )
- mxController = mxFrame->getController();
+ if ( !xFrame.is() )
+ throw IllegalArgumentException(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "PPPOptimizerDialog must be initialized with an "
+ "XFrame, XController or XModel!") ),
+ Reference< XInterface >(), 0 );
+
+ aGuard.reset();
+ mxFrame = xFrame;
+ mxParentWindow.set( xWindow, UNO_QUERY );
+ mbInitialized = true;
+ aGuard.clear();
}
// -----------------------------------------------------------------------------
@@ -90,110 +148,48 @@ Sequence< OUString > SAL_CALL PPPOptimizerDialog::getSupportedServiceNames()
return PPPOptimizerDialog_getSupportedServiceNames();
}
-// -----------------------------------------------------------------------------
-// XDispatchProvider
-// -----------------------------------------------------------------------------
-Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::queryDispatch(
- const URL& aURL, const ::rtl::OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
+void SAL_CALL PPPOptimizerDialog::setTitle( const ::rtl::OUString& aTitle )
+throw (::com::sun::star::uno::RuntimeException)
{
- Reference < XDispatch > xRet;
- if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) == 0 )
- xRet = this;
-
- return xRet;
+ osl::MutexGuard aGuard( m_aMutex );
+ msTitle = aTitle;
}
-//------------------------------------------------------------------------------
-
-Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizerDialog::queryDispatches(
- const Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( RuntimeException )
+::sal_Int16 SAL_CALL PPPOptimizerDialog::execute( )
+throw (::com::sun::star::uno::RuntimeException)
{
- Sequence< Reference< com::sun::star::frame::XDispatch> > aReturn( aDescripts.getLength() );
- Reference< com::sun::star::frame::XDispatch>* pReturn = aReturn.getArray();
- const com::sun::star::frame::DispatchDescriptor* pDescripts = aDescripts.getConstArray();
- for (sal_Int16 i = 0; i < aDescripts.getLength(); ++i, ++pReturn, ++pDescripts )
+ OSL_TRACE("PPPOptimizerDialog::execute");
+ sal_Int16 aRet = ::com::sun::star::ui::dialogs::ExecutableDialogResults::CANCEL;
+
+ osl::ClearableMutexGuard aGuard( m_aMutex );
+ bool bInit( mbInitialized );
+ Reference< XFrame > xFrame( mxFrame );
+ Reference< XWindowPeer > xParent( mxParentWindow );
+ aGuard.clear();
+
+ if ( !bInit || !xFrame.is() || !xParent.is() )
+ throw RuntimeException();
+ try
{
- *pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags );
+ OptimizerDialog *pDialog(
+ new OptimizerDialog( m_xContext, xFrame, xParent ) );
+ pDialog->setTitle( msTitle );
+ aRet = pDialog->execute();
+ delete pDialog;
}
- return aReturn;
-}
-
-// -----------------------------------------------------------------------------
-// XDispatch
-// -----------------------------------------------------------------------------
-
-void SAL_CALL PPPOptimizerDialog::dispatch( const URL& rURL,
- const Sequence< PropertyValue >& rArguments )
- throw( RuntimeException )
-{
- sal_Int64 nFileSizeSource = 0;
- sal_Int64 nFileSizeDest = 0;
-
- if ( mxController.is() && ( rURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) == 0 ) )
+ catch( ... )
{
- if ( rURL.Path.compareToAscii( "execute" ) == 0 )
- {
- sal_Bool bDialogExecuted = sal_False;
-
- try
- {
- mpOptimizerDialog = new OptimizerDialog( mxMSF, mxFrame, this );
- bDialogExecuted = mpOptimizerDialog->execute();
-
- const Any* pVal( mpOptimizerDialog->maStats.GetStatusValue( TK_FileSizeSource ) );
- if ( pVal )
- *pVal >>= nFileSizeSource;
- pVal = mpOptimizerDialog->maStats.GetStatusValue( TK_FileSizeDestination );
- if ( pVal )
- *pVal >>= nFileSizeDest;
-
- if ( nFileSizeSource && nFileSizeDest )
- {
- rtl::OUStringBuffer sBuf( rtl::OUString::createFromAscii( "Your Presentation has been minimized from:" ) );
- sBuf.append( rtl::OUString::valueOf( nFileSizeSource >> 10 ) );
- sBuf.append( rtl::OUString::createFromAscii( "KB to " ) );
- sBuf.append( rtl::OUString::valueOf( nFileSizeDest >> 10 ) );
- sBuf.append( rtl::OUString::createFromAscii( "KB." ) );
- OUString sResult( sBuf.makeStringAndClear() );
-// mpOptimizerDialog->showMessageBox( sResult, sResult, sal_False );
- }
- delete mpOptimizerDialog, mpOptimizerDialog = NULL;
- }
- catch( ... )
- {
-
- }
- }
- else if ( rURL.Path.compareToAscii( "statusupdate" ) == 0 )
- {
- if ( mpOptimizerDialog )
- mpOptimizerDialog->UpdateStatus( rArguments );
- }
}
-}
-//===============================================
-void SAL_CALL PPPOptimizerDialog::addStatusListener( const Reference< XStatusListener >&, const URL& )
- throw( RuntimeException )
-{
- // TODO
- // OSL_ENSURE( sal_False, "PPPOptimizerDialog::addStatusListener()\nNot implemented yet!" );
-}
-
-//===============================================
-void SAL_CALL PPPOptimizerDialog::removeStatusListener( const Reference< XStatusListener >&, const URL& )
- throw( RuntimeException )
-{
- // TODO
- // OSL_ENSURE( sal_False, "PPPOptimizerDialog::removeStatusListener()\nNot implemented yet!" );
+ return aRet;
}
// -----------------------------------------------------------------------------
OUString PPPOptimizerDialog_getImplementationName()
{
- return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.SunPresentationMinimizerImp" ) );
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
}
Sequence< OUString > PPPOptimizerDialog_getSupportedServiceNames()
diff --git a/sdext/source/minimizer/pppoptimizerdialog.hxx b/sdext/source/minimizer/pppoptimizerdialog.hxx
index f2a176a1c2bf..decb083981d0 100644
--- a/sdext/source/minimizer/pppoptimizerdialog.hxx
+++ b/sdext/source/minimizer/pppoptimizerdialog.hxx
@@ -31,41 +31,46 @@
#include <com/sun/star/beans/XPropertySetInfo.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#ifndef _COM_SUN_STAR_LANG_XMULTI_COMPONENT_FACTORY_HPP_
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
-#endif
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <cppuhelper/implbase4.hxx>
+#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
+#include <com/sun/star/awt/XWindowPeer.hpp>
+
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/basemutex.hxx>
// ----------------------
// - PPPOptimizerDialog -
// ----------------------
-class OptimizerDialog;
-class PPPOptimizerDialog : public ::cppu::WeakImplHelper4<
+class PPPOptimizerDialog : protected ::cppu::BaseMutex,
+ public ::cppu::WeakImplHelper3<
com::sun::star::lang::XInitialization,
com::sun::star::lang::XServiceInfo,
- com::sun::star::frame::XDispatchProvider,
- com::sun::star::frame::XDispatch >
+ com::sun::star::ui::dialogs::XExecutableDialog >
{
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
+private:
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > m_xContext;
+ bool mbInitialized;
com::sun::star::uno::Reference< com::sun::star::frame::XFrame > mxFrame;
- com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController;
-
- OptimizerDialog* mpOptimizerDialog;
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxParentWindow;
+ rtl::OUString msTitle;
public:
- PPPOptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF );
+ PPPOptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
virtual ~PPPOptimizerDialog();
// XInitialization
void SAL_CALL initialize( const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& aArguments )
throw( com::sun::star::uno::Exception, com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::sal_Int16 SAL_CALL execute( ) throw (::com::sun::star::uno::RuntimeException);
+
// XServiceInfo
virtual ::rtl::OUString SAL_CALL getImplementationName()
throw( com::sun::star::uno::RuntimeException );
@@ -75,26 +80,6 @@ public:
virtual com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw( com::sun::star::uno::RuntimeException );
-
- // XDispatchProvider
- virtual com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > SAL_CALL queryDispatch(
- const com::sun::star::util::URL& aURL, const rtl::OUString& aTargetFrameName, sal_Int32 nSearchFlags )
- throw(com::sun::star::uno::RuntimeException);
-
- virtual com::sun::star::uno::Sequence< com::sun::star::uno::Reference< com::sun::star::frame::XDispatch > > SAL_CALL queryDispatches(
- const com::sun::star::uno::Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( com::sun::star::uno::RuntimeException );
-
- // XDispatch
- virtual void SAL_CALL dispatch( const com::sun::star::util::URL& aURL,
- const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& lArguments )
- throw( com::sun::star::uno::RuntimeException );
-
- virtual void SAL_CALL addStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener,
- const com::sun::star::util::URL& aURL )
- throw( com::sun::star::uno::RuntimeException );
- virtual void SAL_CALL removeStatusListener( const com::sun::star::uno::Reference< com::sun::star::frame::XStatusListener >& xListener,
- const com::sun::star::util::URL& aURL )
- throw( com::sun::star::uno::RuntimeException );
};
rtl::OUString PPPOptimizerDialog_getImplementationName();
diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx b/sdext/source/minimizer/pppoptimizertoken.cxx
index 54bd77526b09..5ba89be23a5c 100644
--- a/sdext/source/minimizer/pppoptimizertoken.cxx
+++ b/sdext/source/minimizer/pppoptimizertoken.cxx
@@ -112,7 +112,6 @@ static const TokenTable pTokenTableArray[] =
{ "Alpha", TK_Alpha },
{ "Animated", TK_Animated },
{ "Background", TK_Background },
- { "BitmapPath", TK_BitmapPath },
{ "Border", TK_Border },
{ "Closeable", TK_Closeable },
{ "ColorMode", TK_ColorMode },
@@ -146,11 +145,11 @@ static const TokenTable pTokenTableArray[] =
{ "GraphicURL", TK_GraphicURL },
{ "GraphicStreamURL", TK_GraphicStreamURL },
{ "Height", TK_Height },
- { "HelpFile", TK_HelpFile },
+ { "HelpURL", TK_HelpURL },
{ "Hidden", TK_Hidden },
{ "ID", TK_ID },
{ "ImageURL", TK_ImageURL },
- { "InformationDialog", TK_InformationDialog },
+ { "ParentWindow", TK_ParentWindow },// TODO move it
{ "InputStream", TK_InputStream },
{ "Interlaced", TK_Interlaced },
{ "IsInternal", TK_IsInternal },
@@ -186,7 +185,7 @@ static const TokenTable pTokenTableArray[] =
{ "Spin", TK_Spin },
{ "Step", TK_Step },
{ "State", TK_State },
- { "StatusDispatcher", TK_StatusDispatcher },
+ { "StatusListener", TK_StatusListener },
{ "StringItemList", TK_StringItemList },
{ "Strings", TK_Strings },
{ "TabIndex", TK_TabIndex },
@@ -226,8 +225,8 @@ static const TokenTable pTokenTableArray[] =
{ "CurrentGraphicObject",TK_CurrentGraphicObject },
{ "OLEObjects", TK_OLEObjects },
{ "CurrentOLEObject", TK_CurrentOLEObject },
-
- { "STR_SUN_OPTIMIZATION_WIZARD2",STR_SUN_OPTIMIZATION_WIZARD2 },
+#if 0
+ { "STR_PRESENTATION_MINIMIZER",STR_PRESENTATION_MINIMIZER },
{ "STR_STEPS", STR_STEPS },
{ "STR_HELP", STR_HELP },
{ "STR_BACK", STR_BACK },
@@ -292,7 +291,7 @@ static const TokenTable pTokenTableArray[] =
{ "STR_OPTIMIZING_GRAPHICS", STR_OPTIMIZING_GRAPHICS },
{ "STR_CREATING_OLE_REPLACEMENTS",STR_CREATING_OLE_REPLACEMENTS },
{ "STR_FileSizeSeparator", STR_FILESIZESEPARATOR },
-
+#endif
{ "Last", TK_Last },
{ "NotFound", TK_NotFound }
};
diff --git a/sdext/source/minimizer/pppoptimizertoken.hxx b/sdext/source/minimizer/pppoptimizertoken.hxx
index a2dde3f0edd3..a21f508beac0 100644
--- a/sdext/source/minimizer/pppoptimizertoken.hxx
+++ b/sdext/source/minimizer/pppoptimizertoken.hxx
@@ -88,7 +88,6 @@ enum PPPOptimizerTokenEnum
TK_Alpha,
TK_Animated,
TK_Background,
- TK_BitmapPath,
TK_Border,
TK_Closeable,
TK_ColorMode,
@@ -122,11 +121,11 @@ enum PPPOptimizerTokenEnum
TK_GraphicURL,
TK_GraphicStreamURL,
TK_Height,
- TK_HelpFile,
+ TK_HelpURL,
TK_Hidden,
TK_ID,
TK_ImageURL,
- TK_InformationDialog,
+ TK_ParentWindow,
TK_InputStream,
TK_Interlaced,
TK_IsInternal,
@@ -162,7 +161,7 @@ enum PPPOptimizerTokenEnum
TK_Spin,
TK_Step,
TK_State,
- TK_StatusDispatcher,
+ TK_StatusListener,
TK_StringItemList,
TK_Strings,
TK_TabIndex,
@@ -202,8 +201,8 @@ enum PPPOptimizerTokenEnum
TK_CurrentGraphicObject,
TK_OLEObjects,
TK_CurrentOLEObject,
-
- STR_SUN_OPTIMIZATION_WIZARD2,
+#if 0
+ STR_PRESENTATION_MINIMIZER,
STR_STEPS,
STR_HELP,
STR_BACK,
@@ -268,7 +267,7 @@ enum PPPOptimizerTokenEnum
STR_OPTIMIZING_GRAPHICS,
STR_CREATING_OLE_REPLACEMENTS,
STR_FILESIZESEPARATOR,
-
+#endif
TK_Last,
TK_NotFound
};
diff --git a/sdext/source/minimizer/pppoptimizeruno.cxx b/sdext/source/minimizer/pppoptimizeruno.cxx
index 2f64000c9b7b..39654dcb1a90 100644
--- a/sdext/source/minimizer/pppoptimizeruno.cxx
+++ b/sdext/source/minimizer/pppoptimizeruno.cxx
@@ -19,98 +19,54 @@
*
*************************************************************/
-
-
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
-#include <stdio.h>
-#include <osl/mutex.hxx>
-#include <osl/thread.h>
+#include "pppoptimizer.hxx"
+#include "pppoptimizerdialog.hxx"
+
#include <cppuhelper/factory.hxx>
-#include <pppoptimizer.hxx>
-#include <pppoptimizerdialog.hxx>
+#include <cppuhelper/implementationentry.hxx>
-using namespace ::rtl;
-using namespace ::cppu;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::registry;
-extern "C"
+namespace sdext_presentation_minimizer
{
- void SAL_CALL component_getImplementationEnvironment(
- const sal_Char ** ppEnvTypeName, uno_Environment ** )
+ static struct cppu::ImplementationEntry g_entries[] =
{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
- }
-
- // -------------------------------------------------------------------------
-
- sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
- {
- if (pRegistryKey)
{
- try
- {
- Reference< XRegistryKey > xNewKey;
- sal_Int32 nPos;
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PPPOptimizer_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
- const Sequence< OUString > & rSNL1 = PPPOptimizer_getSupportedServiceNames();
- const OUString * pArray1 = rSNL1.getConstArray();
- for ( nPos = rSNL1.getLength(); nPos--; )
- xNewKey->createKey( pArray1[nPos] );
-
- xNewKey = reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( PPPOptimizerDialog_getImplementationName() );
- xNewKey = xNewKey->createKey( OUString::createFromAscii( "/UNO/SERVICES" ) );
- const Sequence< OUString > & rSNL2 = PPPOptimizerDialog_getSupportedServiceNames();
- const OUString * pArray2 = rSNL2.getConstArray();
- for ( nPos = rSNL2.getLength(); nPos--; )
- xNewKey->createKey( pArray2[nPos] );
+ PPPOptimizer_createInstance,
+ PPPOptimizer_getImplementationName,
+ PPPOptimizer_getSupportedServiceNames,
+ cppu::createSingleComponentFactory,
+ 0,
+ 0
+ },
+ {
+ PPPOptimizerDialog_createInstance,
+ PPPOptimizerDialog_getImplementationName,
+ PPPOptimizer_getSupportedServiceNames,
+ cppu::createSingleComponentFactory,
+ 0,
+ 0
+ },
+ { 0, 0, 0, 0, 0, 0 }
+ };
+}
- return sal_True;
- }
- catch (InvalidRegistryException &)
- {
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
- }
- }
- return sal_False;
+extern "C"
+{
+ SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char **ppEnvTypeName, uno_Environment **/*ppEnv*/ )
+ {
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
- // -------------------------------------------------------------------------
-
- void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
+ SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
+ const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey )
{
- OUString aImplName( OUString::createFromAscii( pImplName ) );
- void* pRet = 0;
-
- if( pServiceManager )
- {
- Reference< XSingleComponentFactory > xFactory;
- if( aImplName.equals( PPPOptimizer_getImplementationName() ) )
- {
- xFactory = createSingleComponentFactory(
- PPPOptimizer_createInstance,
- OUString::createFromAscii( pImplName ),
- PPPOptimizer_getSupportedServiceNames() );
-
- }
- else if( aImplName.equals( PPPOptimizerDialog_getImplementationName() ) )
- {
- xFactory = createSingleComponentFactory(
- PPPOptimizerDialog_createInstance,
- OUString::createFromAscii( pImplName ),
- PPPOptimizerDialog_getSupportedServiceNames() );
- }
- if( xFactory.is() )
- {
- xFactory->acquire();
- pRet = xFactory.get();
- }
- }
- return pRet;
+ return ::cppu::component_getFactoryHelper( pImplName,
+ pServiceManager,
+ pRegistryKey ,
+ sdext_presentation_minimizer::g_entries );
}
}
diff --git a/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu b/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu
deleted file mode 100644
index b178897adf65..000000000000
--- a/sdext/source/minimizer/registry/data/org/openoffice/Office/Addons.xcu
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--***********************************************************
- *
- * 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
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- ***********************************************************-->
-
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="Addons" oor:package="org.openoffice.Office">
- <node oor:name="AddonUI">
- <node oor:name="Images">
- <node oor:name="opt-image" oor:op="replace">
- <prop oor:name="URL">
- <value>vnd.com.sun.star.comp.SunPresentationMinimizer:execute</value>
- </prop>
- <node oor:name="UserDefinedImages">
- <prop oor:name="ImageSmallURL" oor:type="xs:string">
- <value>%origin%/../../../../../bitmaps/opt_16.png</value>
- </prop>
- <prop oor:name="ImageBigURL" oor:type="xs:string">
- <value>%origin%/../../../../../bitmaps/opt_26.png</value>
- </prop>
- <prop oor:name="ImageSmallHCURL" oor:type="xs:string">
- <value>%origin%/../../../../../bitmaps/opt_16_h.png</value>
- </prop>
- <prop oor:name="ImageBigHCURL" oor:type="xs:string">
- <value>%origin%/../../../../../bitmaps/opt_26_h.png</value>
- </prop>
- </node>
- </node>
- </node>
- <node oor:name="OfficeMenuBarMerging">
- <node oor:name="SunPresentationMinimizer" oor:op="replace">
- <node oor:name="Command1" oor:op="replace">
- <prop oor:name="MergePoint">
- <value>.uno:ToolsMenu\.uno:AVMediaPlayer</value>
- </prop>
- <prop oor:name="MergeCommand">
- <value>AddAfter</value>
- </prop>
- <prop oor:name="MergeFallback">
- <value>AddPath</value>
- </prop>
- <prop oor:name="MergeContext">
- <value>com.sun.star.presentation.PresentationDocument</value>
- </prop>
- <node oor:name="MenuItems">
- <node oor:name="SunPresentationMinimizerExecute1" oor:op="replace">
- <prop oor:name="URL" oor:type="xs:string">
- <value>private:separator</value>
- </prop>
- </node>
- <node oor:name="SunPresentationMinimizerExecute2" oor:op="replace">
- <prop oor:name="URL" oor:type="xs:string">
- <value>vnd.com.sun.star.comp.SunPresentationMinimizer:execute</value>
- </prop>
- <prop oor:name="Title" oor:type="xs:string">
- <value xml:lang="en-US">~Minimize Presentation...</value>
- </prop>
- <prop oor:name="Target" oor:type="xs:string">
- <value>_self</value>
- </prop>
- <prop oor:name="Context" oor:type="xs:string">
- <value>com.sun.star.presentation.PresentationDocument</value>
- </prop>
- </node>
- </node>
- </node>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu b/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu
deleted file mode 100644
index ddc034d008c6..000000000000
--- a/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/SunPresentationMinimizer.xcu
+++ /dev/null
@@ -1,404 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--***********************************************************
- *
- * 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
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- ***********************************************************-->
-
-<oor:component-data xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" oor:name="SunPresentationMinimizer" oor:package="org.openoffice.Office.extension">
-
- <prop oor:name="BitmapPath" oor:type="xs:string">
- <value>%origin%/../../../../../../bitmaps</value>
- </prop>
-
- <prop oor:name="HelpFile" oor:type="xs:string">
- <value xml:lang="en-US">%origin%/../../../../../../help/help_en-US.odt</value>
- </prop>
-
- <node oor:name="Strings">
- <prop oor:name="STR_SUN_OPTIMIZATION_WIZARD2">
- <value xml:lang="en-US">@MINIMIZEREXTENSIONPRODUCTNAME@</value>
- </prop>
- <prop oor:name="STR_STEPS">
- <value xml:lang="en-US">Steps</value>
- </prop>
- <prop oor:name="STR_HELP">
- <value xml:lang="en-US">~Help</value>
- </prop>
- <prop oor:name="STR_BACK">
- <value xml:lang="en-US">&lt; ~Back</value>
- </prop>
- <prop oor:name="STR_NEXT">
- <value xml:lang="en-US">~Next &gt;</value>
- </prop>
- <prop oor:name="STR_FINISH">
- <value xml:lang="en-US">~Finish</value>
- </prop>
- <prop oor:name="STR_CANCEL">
- <value xml:lang="en-US">Cancel</value>
- </prop>
- <prop oor:name="STR_INTRODUCTION">
- <value xml:lang="en-US">Introduction</value>
- </prop>
- <prop oor:name="STR_INTRODUCTION_T">
- <value xml:lang="en-US">The @MINIMIZEREXTENSIONPRODUCTNAME@ is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed.
-
- At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation.</value>
- </prop>
- <prop oor:name="STR_CHOSE_SETTINGS">
- <value xml:lang="en-US">~Choose settings for @MINIMIZEREXTENSIONPRODUCTNAME@</value>
- </prop>
- <prop oor:name="STR_REMOVE">
- <value xml:lang="en-US">~Delete</value>
- </prop>
- <prop oor:name="STR_GRAPHIC_OPTIMIZATION">
- <value xml:lang="en-US">Choose settings for optimizing pictures and graphics</value>
- </prop>
- <prop oor:name="STR_IMAGE_OPTIMIZATION">
- <value xml:lang="en-US">Graphics</value>
- </prop>
- <prop oor:name="STR_LOSSLESS_COMPRESSION">
- <value xml:lang="en-US">~Lossless compression</value>
- </prop>
- <prop oor:name="STR_JPEG_COMPRESSION">
- <value xml:lang="en-US">~JPEG compression</value>
- </prop>
- <prop oor:name="STR_QUALITY">
- <value xml:lang="en-US">~Quality in %</value>
- </prop>
- <prop oor:name="STR_REMOVE_CROP_AREA">
- <value xml:lang="en-US">~Delete cropped graphic areas</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION">
- <value xml:lang="en-US">Reduce ~image resolution</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_0">
- <value xml:lang="en-US">0;&lt;no change&gt;</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_1">
- <value xml:lang="en-US">90;90 DPI (screen resolution)</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_2">
- <value xml:lang="en-US">150;150 DPI (projector resolution)</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_3">
- <value xml:lang="en-US">300;300 DPI (print resolution)</value>
- </prop>
- <prop oor:name="STR_EMBED_LINKED_GRAPHICS">
- <value xml:lang="en-US">~Break links to external graphics</value>
- </prop>
- <prop oor:name="STR_OLE_OBJECTS">
- <value xml:lang="en-US">OLE Objects</value>
- </prop>
- <prop oor:name="STR_OLE_OPTIMIZATION">
- <value xml:lang="en-US">Choose settings for replacing OLE objects</value>
- </prop>
- <prop oor:name="STR_OLE_REPLACE">
- <value xml:lang="en-US">Create static replacement graphics for OLE objects</value>
- </prop>
- <prop oor:name="STR_ALL_OLE_OBJECTS">
- <value xml:lang="en-US">For ~all OLE objects</value>
- </prop>
- <prop oor:name="STR_ALIEN_OLE_OBJECTS_ONLY">
- <value xml:lang="en-US">~For OLE objects not based on OpenDocument format</value>
- </prop>
- <prop oor:name="STR_OLE_OBJECTS_DESC">
- <value xml:lang="en-US">Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.
-
-The current presentation contains OLE objects.</value>
- </prop>
- <prop oor:name="STR_NO_OLE_OBJECTS_DESC">
- <value xml:lang="en-US">Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.
-
-The current presentation contains no OLE objects.</value>
- </prop>
- <prop oor:name="STR_SLIDES">
- <value xml:lang="en-US">Slides</value>
- </prop>
- <prop oor:name="STR_CHOOSE_SLIDES">
- <value xml:lang="en-US">Choose which slides to delete</value>
- </prop>
- <prop oor:name="STR_MASTER_PAGES">
- <value xml:lang="en-US">Master Pages</value>
- </prop>
- <prop oor:name="STR_DELETE_MASTER_PAGES">
- <value xml:lang="en-US">Delete unused ~master pages</value>
- </prop>
- <prop oor:name="STR_DELETE_NOTES_PAGES">
- <value xml:lang="en-US">~Clear notes</value>
- </prop>
- <prop oor:name="STR_DELETE_HIDDEN_SLIDES">
- <value xml:lang="en-US">Delete hidden ~slides</value>
- </prop>
- <prop oor:name="STR_CUSTOM_SHOW">
- <value xml:lang="en-US">Delete slides that are not used for the ~custom slide show</value>
- </prop>
- <prop oor:name="STR_SUMMARY">
- <value xml:lang="en-US">Summary</value>
- </prop>
- <prop oor:name="STR_SUMMARY_TITLE">
- <value xml:lang="en-US">Choose where to apply the following changes</value>
- </prop>
- <prop oor:name="STR_PROGRESS">
- <value xml:lang="en-US">Progress</value>
- </prop>
- <prop oor:name="STR_OBJECTS_OPTIMIZED">
- <value xml:lang="en-US">Objects optimized</value>
- </prop>
- <prop oor:name="STR_APPLY_TO_CURRENT">
- <value xml:lang="en-US">~Apply changes to current presentation</value>
- </prop>
- <prop oor:name="STR_AUTOMATICALLY_OPEN">
- <value xml:lang="en-US">~Open newly created presentation</value>
- </prop>
- <prop oor:name="STR_SAVE_SETTINGS">
- <value xml:lang="en-US">~Save settings as</value>
- </prop>
- <prop oor:name="STR_SAVE_AS">
- <value xml:lang="en-US">~Duplicate presentation before applying changes</value>
- </prop>
- <prop oor:name="STR_DELETE_SLIDES">
- <value xml:lang="en-US">Delete %SLIDES slides.</value>
- </prop>
- <prop oor:name="STR_OPTIMIZE_IMAGES">
- <value xml:lang="en-US">Optimize %IMAGES graphics to %QUALITY% JPEG quality at %RESOLUTION DPI.</value>
- </prop>
- <prop oor:name="STR_CREATE_REPLACEMENT">
- <value xml:lang="en-US">Create replacement graphics for %OLE objects.</value>
- </prop>
- <prop oor:name="STR_CURRENT_FILESIZE">
- <value xml:lang="en-US">Current file size:</value>
- </prop>
- <prop oor:name="STR_ESTIMATED_FILESIZE">
- <value xml:lang="en-US">Estimated new file size:</value>
- </prop>
- <prop oor:name="STR_MB">
- <value xml:lang="en-US">%1 MB</value>
- </prop>
- <prop oor:name="MY_SETTINGS">
- <value xml:lang="en-US">My Settings </value>
- </prop>
- <prop oor:name="STR_DEFAULT_SESSION">
- <value xml:lang="en-US">default session</value>
- </prop>
- <prop oor:name="STR_MODIFY_WARNING">
- <value xml:lang="en-US">The optimization will modify the current document. Do you want to continue?</value>
- </prop>
- <prop oor:name="STR_YES">
- <value xml:lang="en-US">~Yes</value>
- </prop>
- <prop oor:name="STR_OK">
- <value xml:lang="en-US">OK</value>
- </prop>
- <prop oor:name="STR_INFO_1">
- <value xml:lang="en-US">The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_INFO_2">
- <value xml:lang="en-US">The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_INFO_3">
- <value xml:lang="en-US">The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_INFO_4">
- <value xml:lang="en-US">The @MINIMIZEREXTENSIONPRODUCTNAME@ has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_DUPLICATING_PRESENTATION">
- <value xml:lang="en-US">Duplicating presentation...</value>
- </prop>
- <prop oor:name="STR_DELETING_SLIDES">
- <value xml:lang="en-US">Deleting slides...</value>
- </prop>
- <prop oor:name="STR_OPTIMIZING_GRAPHICS">
- <value xml:lang="en-US">Optimizing graphics...</value>
- </prop>
- <prop oor:name="STR_CREATING_OLE_REPLACEMENTS">
- <value xml:lang="en-US">Creating replacement graphics for OLE objects...</value>
- </prop>
- <prop oor:name="STR_FILESIZESEPARATOR">
- <value xml:lang="en-US">.</value>
- </prop>
- </node>
- <node oor:name="LastUsedSettings">
- <prop oor:name="Name">
- <value xml:lang="en-US">Projector optimized</value>
- </prop>
- <prop oor:name="JPEGCompression">
- <value>true</value>
- </prop>
- <prop oor:name="JPEGQuality">
- <value>50</value>
- </prop>
- <prop oor:name="RemoveCropArea">
- <value>true</value>
- </prop>
- <prop oor:name="ImageResolution">
- <value>150</value>
- </prop>
- <prop oor:name="EmbedLinkedGraphics">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimization">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimizationType">
- <value>0</value>
- </prop>
- <prop oor:name="DeleteUnusedMasterPages">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteHiddenSlides">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteNotesPages">
- <value>false</value>
- </prop>
- <prop oor:name="SaveAs">
- <value>true</value>
- </prop>
- <prop oor:name="OpenNewDocument">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="Settings">
- <node oor:name="Templates">
- <node oor:name="template1" oor:op="replace">
- <prop oor:name="Name">
- <value xml:lang="en-US">Screen optimized (smallest file size)</value>
- </prop>
- <prop oor:name="JPEGCompression">
- <value>true</value>
- </prop>
- <prop oor:name="JPEGQuality">
- <value>25</value>
- </prop>
- <prop oor:name="RemoveCropArea">
- <value>true</value>
- </prop>
- <prop oor:name="ImageResolution">
- <value>90</value>
- </prop>
- <prop oor:name="EmbedLinkedGraphics">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimization">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimizationType">
- <value>0</value>
- </prop>
- <prop oor:name="DeleteUnusedMasterPages">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteHiddenSlides">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteNotesPages">
- <value>false</value>
- </prop>
- <prop oor:name="SaveAs">
- <value>true</value>
- </prop>
- <prop oor:name="OpenNewDocument">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="template2" oor:op="replace">
- <prop oor:name="Name">
- <value xml:lang="en-US">Projector optimized</value>
- </prop>
- <prop oor:name="JPEGCompression">
- <value>true</value>
- </prop>
- <prop oor:name="JPEGQuality">
- <value>50</value>
- </prop>
- <prop oor:name="RemoveCropArea">
- <value>true</value>
- </prop>
- <prop oor:name="ImageResolution">
- <value>150</value>
- </prop>
- <prop oor:name="EmbedLinkedGraphics">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimization">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimizationType">
- <value>0</value>
- </prop>
- <prop oor:name="DeleteUnusedMasterPages">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteHiddenSlides">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteNotesPages">
- <value>false</value>
- </prop>
- <prop oor:name="SaveAs">
- <value>true</value>
- </prop>
- <prop oor:name="OpenNewDocument">
- <value>true</value>
- </prop>
- </node>
- <node oor:name="template3" oor:op="replace">
- <prop oor:name="Name">
- <value xml:lang="en-US">Print optimized</value>
- </prop>
- <prop oor:name="JPEGCompression">
- <value>true</value>
- </prop>
- <prop oor:name="JPEGQuality">
- <value>75</value>
- </prop>
- <prop oor:name="RemoveCropArea">
- <value>true</value>
- </prop>
- <prop oor:name="ImageResolution">
- <value>300</value>
- </prop>
- <prop oor:name="EmbedLinkedGraphics">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimization">
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimizationType">
- <value>0</value>
- </prop>
- <prop oor:name="DeleteUnusedMasterPages">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteHiddenSlides">
- <value>true</value>
- </prop>
- <prop oor:name="DeleteNotesPages">
- <value>false</value>
- </prop>
- <prop oor:name="SaveAs">
- <value>true</value>
- </prop>
- <prop oor:name="OpenNewDocument">
- <value>true</value>
- </prop>
- </node>
- </node>
- </node>
-</oor:component-data>
diff --git a/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk b/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk
deleted file mode 100644
index 2d2d03db6a2a..000000000000
--- a/sdext/source/minimizer/registry/data/org/openoffice/Office/extension/makefile.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-#**************************************************************
-#
-# 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
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-PRJ=..$/..$/..$/..$/..$/..$/..$/..
-
-PRJNAME=sdext
-TARGET=data_ooOfficeext
-PACKAGE=org.openoffice.Office.extension
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/source$/minimizer$/minimizer.pmk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-XCSROOT=$(PRJ)$/source$/minimizer
-ABSXCSROOT=$(PWD)$/$(PRJ)$/source$/minimizer
-
-# --- Targets ------------------------------------------------------
-
-XCUFILES= \
- SunPresentationMinimizer.xcu
-
-MODULEFILES=
-
-LOCALIZEDFILES= \
- SunPresentationMinimizer.xcu
-
-.INCLUDE : target.mk
diff --git a/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk b/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk
deleted file mode 100644
index 7370b2518178..000000000000
--- a/sdext/source/minimizer/registry/data/org/openoffice/Office/makefile.mk
+++ /dev/null
@@ -1,44 +0,0 @@
-#**************************************************************
-#
-# 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
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#**************************************************************
-
-
-PRJ=..$/..$/..$/..$/..$/..$/..
-
-PRJNAME=sdext
-TARGET=data_ooOffice
-PACKAGE=org.openoffice.Office
-
-.INCLUDE : settings.mk
-.INCLUDE : $(PRJ)$/source$/minimizer$/minimizer.pmk
-.INCLUDE : $(PRJ)$/util$/makefile.pmk
-
-# --- Targets ------------------------------------------------------
-
-XCUFILES= \
- Addons.xcu \
- ProtocolHandler.xcu
-
-MODULEFILES=
-
-LOCALIZEDFILES= \
- Addons.xcu
-
-.INCLUDE : target.mk
diff --git a/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs b/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs
deleted file mode 100644
index 0d8106ae7524..000000000000
--- a/sdext/source/minimizer/registry/schema/org/openoffice/Office/extension/SunPresentationMinimizer.xcs
+++ /dev/null
@@ -1,346 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--***********************************************************
- *
- * 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
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- ***********************************************************-->
-<oor:component-schema oor:name="SunPresentationMinimizer" oor:package="org.openoffice.Office.extension" xml:lang="en-US" xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <templates>
- <group oor:name="OptimizerSettings">
- <info>
- <desc>Describes the Presentation Optimization Wizard settings of one session</desc>
- </info>
- <prop oor:name="Name" oor:type="xs:string" oor:localized="true">
- <info>
- <desc>Specifies the name settings name</desc>
- </info>
- <value>Default</value>
- </prop>
- <prop oor:name="JPEGCompression" oor:type="xs:boolean">
- <info>
- <desc>Specifies if JPEG compression is being used</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="JPEGQuality" oor:type="xs:int">
- <info>
- <desc>Specifies quality of the JPG export. A higher value results in higher quality and file size.</desc>
- </info>
- <constraints>
- <minInclusive oor:value="1">
- <info>
- <desc>Represents lowest value that can be used. The lower the value, the less good is the compression quality and the bigger is be the file size.</desc>
- </info>
- </minInclusive>
- <maxInclusive oor:value="100">
- <info>
- <desc>Represents highest value that can be used. The higher the value, the better is the compression quality and the smaller is the file size.</desc>
- </info>
- </maxInclusive>
- </constraints>
- <value>45</value>
- </prop>
- <prop oor:name="RemoveCropArea" oor:type="xs:boolean">
- <info>
- <desc>Specifies if the crop area of a picture has to be removed</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="ImageResolution" oor:type="xs:int">
- <info>
- <desc>Specifies the Image Resolution that should be used in dpi. A value of zero determines that the image resolution should not be changed.</desc>
- </info>
- <value>150</value>
- </prop>
- <prop oor:name="EmbedLinkedGraphics" oor:type="xs:boolean">
- <info>
- <desc>Specifies if linked graphics are to be embedded</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimization" oor:type="xs:boolean">
- <info>
- <desc>Specifies if OLE Objects are converted to Graphic objects at all</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="OLEOptimizationType" oor:type="xs:short">
- <info>
- <desc>Specifies the compression type that is being used,.</desc>
- </info>
- <constraints>
- <enumeration oor:value="0"><info><desc>Each</desc></info></enumeration>
- <enumeration oor:value="1"><info><desc>Alien</desc></info></enumeration>
- </constraints>
- <value>0</value>
- </prop>
- <prop oor:name="DeleteUnusedMasterPages" oor:type="xs:boolean">
- <info>
- <desc>Specifies if unused Master Pages are being deleted</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="DeleteHiddenSlides" oor:type="xs:boolean">
- <info>
- <desc>Specifies if hidden Slides are being deleted</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="DeleteNotesPages" oor:type="xs:boolean">
- <info>
- <desc>Specifies if Notes Pages are being deleted</desc>
- </info>
- <value>false</value>
- </prop>
- <prop oor:name="SaveAs" oor:type="xs:boolean">
- <info>
- <desc>Specifies if the optimization is done on a new document.</desc>
- </info>
- <value>true</value>
- </prop>
- <prop oor:name="OpenNewDocument" oor:type="xs:boolean">
- <info>
- <desc>Specifies if the newly created document is opened automatically.</desc>
- </info>
- <value>true</value>
- </prop>
- </group>
- </templates>
- <component>
- <prop oor:name="BitmapPath" oor:type="xs:string"/>
- <prop oor:name="HelpFile" oor:type="xs:string"/>
- <group oor:name="Strings">
- <prop oor:name="STR_SUN_OPTIMIZATION_WIZARD2" oor:type="xs:string" oor:localized="true">
- <value>Presentation Minimizer</value>
- </prop>
- <prop oor:name="STR_STEPS" oor:type="xs:string" oor:localized="true">
- <value>Steps</value>
- </prop>
- <prop oor:name="STR_HELP" oor:type="xs:string" oor:localized="true">
- <value>~Help</value>
- </prop>
- <prop oor:name="STR_BACK" oor:type="xs:string" oor:localized="true">
- <value>&lt; ~Back</value>
- </prop>
- <prop oor:name="STR_NEXT" oor:type="xs:string" oor:localized="true">
- <value>~Next &gt;</value>
- </prop>
- <prop oor:name="STR_FINISH" oor:type="xs:string" oor:localized="true">
- <value>~Finish</value>
- </prop>
- <prop oor:name="STR_CANCEL" oor:type="xs:string" oor:localized="true">
- <value>Cancel</value>
- </prop>
- <prop oor:name="STR_INTRODUCTION" oor:type="xs:string" oor:localized="true">
- <value>Introduction</value>
- </prop>
- <prop oor:name="STR_INTRODUCTION_T" oor:type="xs:string" oor:localized="true">
- <value>The Presentation Minimizer is used to reduce the file size of the current presentation. Images will be compressed and data, that is no longer needed, will be removed.
-
- At the last step of the wizard you can choose to apply the changes to the current presentation or to create an optimized new version of the presentation.</value>
- </prop>
- <prop oor:name="STR_CHOSE_SETTINGS" oor:type="xs:string" oor:localized="true">
- <value>~Choose settings for the Presentation Minimization Wizard</value>
- </prop>
- <prop oor:name="STR_REMOVE" oor:type="xs:string" oor:localized="true">
- <value>~Delete</value>
- </prop>
- <prop oor:name="STR_GRAPHIC_OPTIMIZATION" oor:type="xs:string" oor:localized="true">
- <value>Choose settings for optimizing pictures and graphics</value>
- </prop>
- <prop oor:name="STR_IMAGE_OPTIMIZATION" oor:type="xs:string" oor:localized="true">
- <value>Graphics</value>
- </prop>
- <prop oor:name="STR_LOSSLESS_COMPRESSION" oor:type="xs:string" oor:localized="true">
- <value>~Lossless compression</value>
- </prop>
- <prop oor:name="STR_JPEG_COMPRESSION" oor:type="xs:string" oor:localized="true">
- <value>~JPEG compression</value>
- </prop>
- <prop oor:name="STR_QUALITY" oor:type="xs:string" oor:localized="true">
- <value>~Quality</value>
- </prop>
- <prop oor:name="STR_REMOVE_CROP_AREA" oor:type="xs:string" oor:localized="true">
- <value>~Delete cropped graphic areas</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION" oor:type="xs:string" oor:localized="true">
- <value>~Image Resolution</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_0" oor:type="xs:string" oor:localized="true">
- <value>0;&lt;no change&gt;</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_1" oor:type="xs:string" oor:localized="true">
- <value>90;90 DPI (screen resolution)</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_2" oor:type="xs:string" oor:localized="true">
- <value>150;150 DPI (projector resolution)</value>
- </prop>
- <prop oor:name="STR_IMAGE_RESOLUTION_3" oor:type="xs:string" oor:localized="true">
- <value>300;300 DPI (print resolution)</value>
- </prop>
- <prop oor:name="STR_EMBED_LINKED_GRAPHICS" oor:type="xs:string" oor:localized="true">
- <value>~Break links to external graphics</value>
- </prop>
- <prop oor:name="STR_OLE_OBJECTS" oor:type="xs:string" oor:localized="true">
- <value>OLE Objects</value>
- </prop>
- <prop oor:name="STR_OLE_OPTIMIZATION" oor:type="xs:string" oor:localized="true">
- <value>Choose settings for replacing OLE objects</value>
- </prop>
- <prop oor:name="STR_OLE_REPLACE" oor:type="xs:string" oor:localized="true">
- <value>Create static replacement graphics for OLE objects</value>
- </prop>
- <prop oor:name="STR_ALL_OLE_OBJECTS" oor:type="xs:string" oor:localized="true">
- <value>For ~all OLE objects</value>
- </prop>
- <prop oor:name="STR_ALIEN_OLE_OBJECTS_ONLY" oor:type="xs:string" oor:localized="true">
- <value>~For OLE objects not based on OpenDocument format</value>
- </prop>
- <prop oor:name="STR_OLE_OBJECTS_DESC" oor:type="xs:string" oor:localized="true">
- <value>Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.
-
-The current presentation contains no OLE objects.</value>
- </prop>
- <prop oor:name="STR_NO_OLE_OBJECTS_DESC" oor:type="xs:string" oor:localized="true">
- <value>Object Linking and Embedding (OLE) is a technology that allows embedding and linking to documents and other objects.
-
-The current presentation contains no OLE objects.</value>
- </prop>
- <prop oor:name="STR_SLIDES" oor:type="xs:string" oor:localized="true">
- <value>Slides</value>
- </prop>
- <prop oor:name="STR_CHOOSE_SLIDES" oor:type="xs:string" oor:localized="true">
- <value>Choose which slides to delete</value>
- </prop>
- <prop oor:name="STR_MASTER_PAGES" oor:type="xs:string" oor:localized="true">
- <value>Master Pages</value>
- </prop>
- <prop oor:name="STR_DELETE_MASTER_PAGES" oor:type="xs:string" oor:localized="true">
- <value>Delete unused ~master pages</value>
- </prop>
- <prop oor:name="STR_DELETE_NOTES_PAGES" oor:type="xs:string" oor:localized="true">
- <value>~Clear notes</value>
- </prop>
- <prop oor:name="STR_DELETE_HIDDEN_SLIDES" oor:type="xs:string" oor:localized="true">
- <value>Delete hidden ~slides</value>
- </prop>
- <prop oor:name="STR_CUSTOM_SHOW" oor:type="xs:string" oor:localized="true">
- <value>Delete slides that are not used for the ~custom slide show</value>
- </prop>
- <prop oor:name="STR_SUMMARY" oor:type="xs:string" oor:localized="true">
- <value>Summary</value>
- </prop>
- <prop oor:name="STR_SUMMARY_TITLE" oor:type="xs:string" oor:localized="true">
- <value>Choose where to apply the following changes</value>
- </prop>
- <prop oor:name="STR_PROGRESS" oor:type="xs:string" oor:localized="true">
- <value>Progress</value>
- </prop>
- <prop oor:name="STR_OBJECTS_OPTIMIZED" oor:type="xs:string" oor:localized="true">
- <value>Objects optimized</value>
- </prop>
- <prop oor:name="STR_APPLY_TO_CURRENT" oor:type="xs:string" oor:localized="true">
- <value>~Apply changes to current presentation</value>
- </prop>
- <prop oor:name="STR_AUTOMATICALLY_OPEN" oor:type="xs:string" oor:localized="true">
- <value>~Open newly created presentation</value>
- </prop>
- <prop oor:name="STR_SAVE_SETTINGS" oor:type="xs:string" oor:localized="true">
- <value>~Save settings as</value>
- </prop>
- <prop oor:name="STR_SAVE_AS" oor:type="xs:string" oor:localized="true">
- <value>~Duplicate presentation before applying changes</value>
- </prop>
- <prop oor:name="STR_DELETE_SLIDES" oor:type="xs:string" oor:localized="true">
- <value>Delete %SLIDES slides</value>
- </prop>
- <prop oor:name="STR_OPTIMIZE_IMAGES" oor:type="xs:string" oor:localized="true">
- <info>
- <desc>The following string is only used in plural.</desc>
- </info>
- <value>Optimize %IMAGES graphics to %QUALITY% JPEG quality at %RESOLUTION DPI.</value>
- </prop>
- <prop oor:name="STR_CREATE_REPLACEMENT" oor:type="xs:string" oor:localized="true">
- <value>Create replacement graphics for %OLE objects.</value>
- </prop>
- <prop oor:name="STR_CURRENT_FILESIZE" oor:type="xs:string" oor:localized="true">
- <value>Current file size:</value>
- </prop>
- <prop oor:name="STR_ESTIMATED_FILESIZE" oor:type="xs:string" oor:localized="true">
- <value>Estimated new file size:</value>
- </prop>
- <prop oor:name="STR_MB" oor:type="xs:string" oor:localized="true">
- <value>%1 MB</value>
- </prop>
- <prop oor:name="MY_SETTINGS" oor:type="xs:string" oor:localized="true">
- <value>My Settings</value>
- </prop>
- <prop oor:name="STR_DEFAULT_SESSION" oor:type="xs:string" oor:localized="true">
- <value>default session</value>
- </prop>
- <prop oor:name="STR_MODIFY_WARNING" oor:type="xs:string" oor:localized="true">
- <value>The optimization will modify the current document. Do you want to continue?</value>
- </prop>
- <prop oor:name="STR_YES" oor:type="xs:string" oor:localized="true">
- <value>~Yes</value>
- </prop>
- <prop oor:name="STR_OK" oor:type="xs:string" oor:localized="true">
- <value>OK</value>
- </prop>
- <prop oor:name="STR_INFO_1" oor:type="xs:string" oor:localized="true">
- <value>The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_INFO_2" oor:type="xs:string" oor:localized="true">
- <value>The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to approximated %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_INFO_3" oor:type="xs:string" oor:localized="true">
- <value>The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_INFO_4" oor:type="xs:string" oor:localized="true">
- <value>The Presentation Minimizer has successfully updated the presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE MB.</value>
- </prop>
- <prop oor:name="STR_DUPLICATING_PRESENTATION" oor:type="xs:string" oor:localized="true">
- <value>Duplicating presentation...</value>
- </prop>
- <prop oor:name="STR_DELETING_SLIDES" oor:type="xs:string" oor:localized="true">
- <value>Deleting slides...</value>
- </prop>
- <prop oor:name="STR_OPTIMIZING_GRAPHICS" oor:type="xs:string" oor:localized="true">
- <value>Optimizing graphics...</value>
- </prop>
- <prop oor:name="STR_CREATING_OLE_REPLACEMENTS" oor:type="xs:string" oor:localized="true">
- <value>Creating replacement graphics for OLE objects...</value>
- </prop>
- <prop oor:name="STR_FILESIZESEPARATOR" oor:type="xs:string" oor:localized="true">
- <value>.</value>
- </prop>
- </group>
- <node-ref oor:name="LastUsedSettings" oor:node-type="OptimizerSettings">
- <info>
- <desc>describes the name of the last used settings</desc>
- </info>
- </node-ref>
- <group oor:name="Settings">
- <set oor:name="Templates" oor:node-type="OptimizerSettings">
- <info>
- <desc>List of the saved Presentation Optimization Wizard settings</desc>
- </info>
- </set>
- </group>
- </component>
-</oor:component-schema>
diff --git a/sdext/source/minimizer/unodialog.cxx b/sdext/source/minimizer/unodialog.cxx
index 3bd352271d6a..30bf8ca35a97 100644
--- a/sdext/source/minimizer/unodialog.cxx
+++ b/sdext/source/minimizer/unodialog.cxx
@@ -25,20 +25,23 @@
#include "precompiled_sdext.hxx"
#include "unodialog.hxx"
-#include <com/sun/star/text/XTextRange.hpp>
-#include <com/sun/star/drawing/XShapes.hpp>
+
+#include <com/sun/star/awt/MessageBoxButtons.hpp>
+#include <com/sun/star/awt/XVclWindowPeer.hpp>
+#include <com/sun/star/awt/PosSize.hpp>
+#include <com/sun/star/awt/XMessageBoxFactory.hpp>
+#include <com/sun/star/awt/XStyleSettingsSupplier.hpp>
#include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/view/XSelectionSupplier.hpp>
-#include <com/sun/star/view/XControlAccess.hpp>
+#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/awt/XMessageBoxFactory.hpp>
-#include <com/sun/star/awt/MessageBoxButtons.hpp>
+#include <com/sun/star/text/XTextRange.hpp>
+#include <com/sun/star/view/XControlAccess.hpp>
+#include <com/sun/star/view/XSelectionSupplier.hpp>
// -------------
// - UnoDialog -
// -------------
-using namespace ::rtl;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
@@ -48,44 +51,58 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::script;
-UnoDialog::UnoDialog( const Reference< XComponentContext > &rxMSF, Reference< XFrame >& rxFrame ) :
- mxMSF( rxMSF ),
- mxController( rxFrame->getController() ),
- mxDialogModel( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.UnoControlDialogModel" ) ), mxMSF ), UNO_QUERY_THROW ),
+using ::rtl::OUString;
+
+UnoDialog::UnoDialog(
+ const Reference< XComponentContext > &rxContext,
+ const Reference< XWindowPeer >& rxParent ) :
+ mxContext( rxContext ),
+ mxParent( rxParent ),
+ mxDialogModel( mxContext->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.awt.UnoControlDialogModel" ) ), mxContext ), UNO_QUERY_THROW ),
mxDialogModelMultiPropertySet( mxDialogModel, UNO_QUERY_THROW ),
mxDialogModelPropertySet( 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( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.UnoControlDialog" ) ), mxMSF ), UNO_QUERY_THROW ),
+ mxDialog( mxContext->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.awt.UnoControlDialog" ) ), mxContext ), UNO_QUERY_THROW ),
mxControl( mxDialog, UNO_QUERY_THROW ),
mbStatus( sal_False )
{
+ OSL_TRACE("UnoDialog::UnoDialog");
mxControl->setModel( mxControlModel );
mxDialogControlContainer = Reference< XControlContainer >( mxDialog, UNO_QUERY_THROW );
- mxDialogComponent = Reference< XComponent >( mxDialog, UNO_QUERY_THROW );
- mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY_THROW );
-
- Reference< XFrame > xFrame( mxController->getFrame() );
- Reference< XWindow > xContainerWindow( xFrame->getContainerWindow() );
- mxWindowPeer = Reference< XWindowPeer >( xContainerWindow, UNO_QUERY_THROW );
- createWindowPeer( mxWindowPeer );
+ mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY );
+ mxDialogWindowPeer = createWindowPeer();
}
// -----------------------------------------------------------------------------
UnoDialog::~UnoDialog()
{
-
+ OSL_TRACE("UnoDialog::~UnoDialog");
+ Reference< XComponent > xComponent( mxDialog, UNO_QUERY );
+ if ( xComponent.is() )
+ {
+ xComponent->dispose();
+ }
}
// -----------------------------------------------------------------------------
+void UnoDialog::setTitle( const rtl::OUString &rTitle )
+{
+ if ( rTitle.getLength() )
+ {
+ mxDialog->setTitle( rTitle );
+ }
+}
+
void UnoDialog::execute()
{
+ OSL_TRACE("UnoDialog::execute");
mxDialogWindow->setEnable( sal_True );
mxDialogWindow->setVisible( sal_True );
mxDialog->execute();
@@ -93,22 +110,55 @@ void UnoDialog::execute()
void UnoDialog::endExecute( sal_Bool bStatus )
{
+ OSL_TRACE("UnoDialog::endExecute");
mbStatus = bStatus;
mxDialog->endExecute();
}
+void UnoDialog::centerDialog()
+{
+ Reference< XWindow > xParent( mxParent, UNO_QUERY );
+ if ( !xParent.is() )
+ return;
+
+ Rectangle aParentPosSize = xParent->getPosSize();
+ Rectangle aWinPosSize = mxDialogWindow->getPosSize();
+ Point aWinPos((aParentPosSize.Width - aWinPosSize.Width) / 2,
+ (aParentPosSize.Height - aWinPosSize.Height) / 2);
+
+ if ( ( aWinPos.X + aWinPosSize.Width ) > ( aParentPosSize.X + aParentPosSize.Width ) )
+ aWinPos.X = aParentPosSize.X + aParentPosSize.Width - aWinPosSize.Width;
+
+ if ( ( aWinPos.Y + aWinPosSize.Height ) > ( aParentPosSize.Y + aParentPosSize.Height ) )
+ aWinPos.Y = aParentPosSize.Y + aParentPosSize.Height - aWinPosSize.Height;
+
+ mxDialogWindow->setPosSize( aWinPos.X, aWinPos.Y,
+ aWinPosSize.Width,
+ aWinPosSize.Height,
+ PosSize::POS );
+}
+
// -----------------------------------------------------------------------------
-Reference< XWindowPeer > UnoDialog::createWindowPeer( Reference< XWindowPeer > xParentPeer )
+Reference< XWindowPeer > UnoDialog::createWindowPeer()
throw ( Exception )
{
mxDialogWindow->setVisible( sal_False );
- Reference< XToolkit > xToolkit( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.Toolkit" ) ), mxMSF ), UNO_QUERY_THROW );
- if ( !xParentPeer.is() )
- xParentPeer = xToolkit->getDesktopWindow();
+
+ // reuse the parent's toolkit
+ Reference< XToolkit > xToolkit;
+ if ( mxParent.is() )
+ xToolkit.set( mxParent->getToolkit() );
+
+ if ( !xToolkit.is() )
+ xToolkit.set( mxContext->getServiceManager()->createInstanceWithContext(
+ OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.awt.Toolkit" ) ), mxContext ),
+ UNO_QUERY_THROW );
+
mxReschedule = Reference< XReschedule >( xToolkit, UNO_QUERY );
- mxControl->createPeer( xToolkit, xParentPeer );
-// xWindowPeer = xControl.getPeer();
+ mxControl->createPeer( xToolkit, mxParent );
+
return mxControl->getPeer();
}
@@ -153,14 +203,9 @@ sal_Bool UnoDialog::isHighContrast()
sal_Bool bHighContrast = sal_False;
try
{
- sal_Int32 nBackgroundColor = 0;
- if ( mxDialogModelPropertySet->getPropertyValue( OUString( RTL_CONSTASCII_USTRINGPARAM( "BackgroundColor" ) ) ) >>= nBackgroundColor )
- {
- sal_uInt8 nLum( static_cast< sal_uInt8 >( ( static_cast< sal_uInt8 >( nBackgroundColor >> 16 ) * 28 +
- static_cast< sal_uInt8 >( nBackgroundColor >> 8 ) * 151 +
- static_cast< sal_uInt8 >( nBackgroundColor ) * 77 ) >> 8 ) );
- bHighContrast = nLum <= 38;
- }
+ Reference< XStyleSettingsSupplier > xStyleSettingsSuppl( mxDialogWindow, UNO_QUERY_THROW );
+ Reference< XStyleSettings > xStyleSettings( xStyleSettingsSuppl->getStyleSettings() );
+ bHighContrast = xStyleSettings->getHighContrastMode();
}
catch( Exception& )
{
diff --git a/sdext/source/minimizer/unodialog.hxx b/sdext/source/minimizer/unodialog.hxx
index c78b4147a25c..fb9fe2d46a0b 100644
--- a/sdext/source/minimizer/unodialog.hxx
+++ b/sdext/source/minimizer/unodialog.hxx
@@ -26,9 +26,7 @@
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#ifndef _COM_SUN_STAR_LANG_XMULTI_COMPONENT_FACTORY_HPP_
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#endif
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XFrame.hpp>
@@ -53,9 +51,6 @@
#include <com/sun/star/awt/XReschedule.hpp>
#include <com/sun/star/awt/XDialog.hpp>
#include <com/sun/star/awt/Size.hpp>
-#include <cppuhelper/implbase1.hxx>
-#include <cppuhelper/implbase2.hxx>
-#include <cppuhelper/implbase3.hxx>
// -------------
// - UnoDialog -
@@ -67,23 +62,24 @@ class UnoDialog
{
public :
- UnoDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF, com::sun::star::uno::Reference< com::sun::star::frame::XFrame >& rxFrame );
- ~UnoDialog();
-
+ UnoDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext,
+ const com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer >& rxParent);
+ virtual ~UnoDialog();
void execute();
void endExecute( sal_Bool bStatus );
+ void setTitle( const rtl::OUString &rTitle);
+
+protected:
+ void setVisible( const rtl::OUString& rName, sal_Bool bVisible );
+ sal_Int32 getMapsFromPixels( sal_Int32 nPixels ) const;
+ sal_Bool isHighContrast();
+ void centerDialog();
- com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer( com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > xParentPeer )
- throw ( com::sun::star::uno::Exception );
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer() throw ( com::sun::star::uno::Exception );
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > insertControlModel( const rtl::OUString& rServiceName, const rtl::OUString& rName,
const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames, const com::sun::star::uno::Sequence< com::sun::star::uno::Any >& rPropertyValues );
- void setVisible( const rtl::OUString& rName, sal_Bool bVisible );
-
- sal_Bool isHighContrast();
-
- sal_Int32 getMapsFromPixels( sal_Int32 nPixels ) const;
com::sun::star::uno::Reference< com::sun::star::awt::XButton > insertButton( const rtl::OUString& rName,
com::sun::star::uno::Reference< com::sun::star::awt::XActionListener > xActionListener, const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames,
@@ -112,15 +108,13 @@ public :
void setControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName, const com::sun::star::uno::Any& rPropertyValue );
com::sun::star::uno::Any getControlProperty( const rtl::OUString& rControlName, const rtl::OUString& rPropertyName );
-#if 0
- void showMessageBox( const rtl::OUString& rTitle, const rtl::OUString& rMessage, sal_Bool bErrorBox ) const;
-#endif
void enableControl( const rtl::OUString& rControlName );
void disableControl( const rtl::OUString& rControlName );
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
- com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController;
- com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule;
+protected:
+
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxParent;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxDialogModel;
com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet > mxDialogModelMultiPropertySet;
@@ -128,18 +122,16 @@ public :
com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxDialogModelMSF;
com::sun::star::uno::Reference< com::sun::star::container::XNameContainer > mxDialogModelNameContainer;
com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > mxDialogModelNameAccess;
-
com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > mxControlModel;
-
com::sun::star::uno::Reference< com::sun::star::awt::XDialog > mxDialog;
com::sun::star::uno::Reference< com::sun::star::awt::XControl > mxControl;
- com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxWindowPeer;
+ sal_Bool mbStatus;
com::sun::star::uno::Reference< com::sun::star::awt::XControlContainer > mxDialogControlContainer;
- com::sun::star::uno::Reference< com::sun::star::lang::XComponent > mxDialogComponent;
com::sun::star::uno::Reference< com::sun::star::awt::XWindow > mxDialogWindow;
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxDialogWindowPeer;
- sal_Bool mbStatus;
+ com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule;
};
#endif // UNODIALOG_HXX