You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ar...@apache.org on 2013/03/16 00:19:21 UTC
svn commit: r1457158 [3/5] - in /openoffice/trunk/main: ./
default_images/minimizer/ default_images/res/commandimagelist/
helpcontent2/prj/ helpcontent2/source/text/simpress/
helpcontent2/source/text/simpress/minimizer/ helpcontent2/util/simpress/
offi...
Modified: openoffice/trunk/main/sdext/source/minimizer/informationdialog.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/informationdialog.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/informationdialog.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/informationdialog.cxx Fri Mar 15 23:19:19 2013
@@ -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,31 +7,38 @@
* 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.
- *
+ *
*************************************************************/
-
+
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_sdext.hxx"
#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( Informati
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( Informatio
Any pValues[] = {
Any( sal_True ),
Any( nHeight ),
+ Any( rHelpURL ),
Any( rLabel ),
Any( nXPos ),
Any( nYPos ),
@@ -157,14 +175,17 @@ rtl::OUString InsertCheckBox( Informatio
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( InformationD
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( InformationD
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( co
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 )
-{
-}
Modified: openoffice/trunk/main/sdext/source/minimizer/informationdialog.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/informationdialog.hxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/informationdialog.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/informationdialog.hxx Fri Mar 15 23:19:19 2013
@@ -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;
+ 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;
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 );
- sal_Int64 mnSourceSize;
- sal_Int64 mnDestSize;
- sal_Int64 mnApproxSize;
- sal_Bool& mrbOpenNewDocument;
- const rtl::OUString& maSaveAsURL;
-
-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:
-
- InformationDialog& mrInformationDialog;
};
#endif
Modified: openoffice/trunk/main/sdext/source/minimizer/makefile.mk
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/makefile.mk?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/makefile.mk (original)
+++ openoffice/trunk/main/sdext/source/minimizer/makefile.mk Fri Mar 15 23:19:19 2013
@@ -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 "$(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)
+
+# ------------------------------------------------------------------------------
+
+# Resource files
+
+SRS1NAME=minimizer
+SRC1FILES = \
+ minimizer.src \
-# --- Targets ----------------------------------
+SRSFILELIST=\
+ $(SRS)$/minimizer.srs \
-.INCLUDE : extension_pre.mk
+RESLIB1NAME=minimizer
+RESLIB1SRSFILES= $(SRSFILELIST)
+
+# --- Targets ----------------------------------
.ENDIF # L10N_framework
.INCLUDE : target.mk
-.IF "$(L10N_framework)"==""
-.INCLUDE : extension_post.mk
-$(COMPONENT_BITMAPS) : $(SOLARSRC)$/$(RSCDEFIMG)$/minimizer$/$$(@:f)
- @@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
-
-$(COMPONENT_IMAGES) : $(SOLARSRC)$/$(RSCDEFIMG)$/desktop$/res$/$$(@:f)
- @@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
-
-$(COMPONENT_HELP) : help$/$$(@:f)
- @@-$(MKDIRHIER) $(@:d)
- $(COPY) $< $@
+ALLTAR : $(MISC)/PresentationMinimizer.component
-.ENDIF # L10N_framework
+$(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
Added: openoffice/trunk/main/sdext/source/minimizer/minimizer.hrc
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/minimizer.hrc?rev=1457158&view=auto
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/minimizer.hrc (added)
+++ openoffice/trunk/main/sdext/source/minimizer/minimizer.hrc Fri Mar 15 23:19:19 2013
@@ -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
Added: openoffice/trunk/main/sdext/source/minimizer/minimizer.src
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/minimizer.src?rev=1457158&view=auto
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/minimizer.src (added)
+++ openoffice/trunk/main/sdext/source/minimizer/minimizer.src Fri Mar 15 23:19:19 2013
@@ -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 ] = ".";
+};
Modified: openoffice/trunk/main/sdext/source/minimizer/optimizationstats.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/optimizationstats.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/optimizationstats.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/optimizationstats.cxx Fri Mar 15 23:19:19 2013
@@ -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()
Modified: openoffice/trunk/main/sdext/source/minimizer/optimizerdialog.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/optimizerdialog.cxx?rev=1457158&r1=1457157&r2=1457158&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/optimizerdialog.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/optimizerdialog.cxx Fri Mar 15 23:19:19 2013
@@ -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::UpdateConfiguratio
// -----------------------------------------------------------------------------
-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 )
-{
- Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY_THROW );
+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 )
+{
+ 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
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( cons
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( cons
// -----------------------------------------------------------------------------
-void ItemListener::itemStateChanged( const ItemEvent& Event )
+void OptimizerDialog::itemStateChanged( const ItemEvent& Event )
throw ( RuntimeException )
{
try
@@ -388,28 +423,28 @@ void ItemListener::itemStateChanged( con
{
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( con
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( con
{
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( con
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( con
}
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( co
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( co
}
// 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( co
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( co
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;
- }
-}
-void ActionListener::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
-}
-
-// -----------------------------------------------------------------------------
-
-void ActionListenerListBox0Pg0::actionPerformed( const ActionEvent& rEvent )
- throw ( com::sun::star::uno::RuntimeException )
-{
- if ( rEvent.ActionCommand.getLength() )
- {
- std::vector< OptimizerSettings >::iterator aIter( mrOptimizerDialog.GetOptimizerSettingsByName( rEvent.ActionCommand ) );
- std::vector< OptimizerSettings >& rList( mrOptimizerDialog.GetOptimizerSettings() );
- if ( aIter != rList.end() )
- rList[ 0 ] = *aIter;
+ 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;
}
- 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 OptimizerDialog::textChanged( const TextEvent& rEvent )
+ throw ( com::sun::star::uno::RuntimeException )
+{
+ Reference< XSpinField > xFormattedField( rEvent.Source, UNO_QUERY );
+ if ( xFormattedField.is() )
+ {
+ double fDouble = 0;
+ Any aAny = getControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ) );
+ if ( aAny >>= fDouble )
+ SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
+ return;
+ }
-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 )
- {
- 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 );
+ Reference< XComboBox > xComboBox( rEvent.Source, UNO_QUERY );
+ if ( xComboBox.is() )
+ {
+ 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 );
- mrOptimizerDialog.SetConfigProperty( TK_ImageResolution, Any( aString.toInt32() ) );
- }
-}
-void TextListenerComboBox0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
- throw ( com::sun::star::uno::RuntimeException )
-{
+ SetConfigProperty( TK_ImageResolution, Any( aString.toInt32() ) );
+ }
+ }
}
// -----------------------------------------------------------------------------
-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;
-}