summaryrefslogtreecommitdiff
path: root/sdext/source/minimizer/optimizerdialog.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sdext/source/minimizer/optimizerdialog.cxx')
-rw-r--r--sdext/source/minimizer/optimizerdialog.cxx57
1 files changed, 29 insertions, 28 deletions
diff --git a/sdext/source/minimizer/optimizerdialog.cxx b/sdext/source/minimizer/optimizerdialog.cxx
index d795e6a..c5439df 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -1,7 +1,8 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
*
* OpenOffice.org - a multi-platform office productivity suite
@@ -33,11 +34,10 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ucb/XSimpleFileAccess.hpp>
#include <com/sun/star/io/XInputStream.hpp>
-#ifndef _COM_SUN_STAR_UTIL_XCloseBroadcaster_HPP_
#include <com/sun/star/util/XCloseBroadcaster.hpp>
-#endif
#include <com/sun/star/frame/XComponentLoader.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <sal/macros.h>
#include <osl/time.h>
// -------------------
@@ -80,13 +80,13 @@ void OptimizerDialog::InitDialog()
Any( sal_Int32( 52 ) ),
Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ),
Any( sal_Int32( OD_DIALOG_WIDTH ) ) };
-
- sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString );
+
+ sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- mxDialogModelMultiPropertySet->setPropertyValues( aNames, aValues );
+ mxDialogModelMultiPropertySet->setPropertyValues( aNames, aValues );
}
// -----------------------------------------------------------------------------
@@ -111,7 +111,7 @@ void OptimizerDialog::InitRoadmap()
Any( mnTabIndex++ ),
Any( sal_Int32( 85 ) ) };
- sal_Int32 nCount = sizeof( pNames ) / sizeof( OUString );
+ sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
@@ -129,8 +129,7 @@ void OptimizerDialog::InitRoadmap()
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 sBitmap( RTL_CONSTASCII_USTRINGPARAM("/minimizepresi_80.png") );
rtl::OUString sURL( sBitmapPath += sBitmap );
xPropertySet->setPropertyValue( TKGet( TK_ImageURL ), Any( sURL ) );
@@ -175,7 +174,7 @@ void OptimizerDialog::UpdateConfiguration()
Sequence< sal_Int16 > aSelectedItems;
Sequence< OUString > aStringItemList;
-
+
// page0
aAny = getControlProperty( TKGet( TK_ListBox0Pg0 ), TKGet( TK_SelectedItems ) );
if ( aAny >>= aSelectedItems )
@@ -283,14 +282,14 @@ void OptimizerDialog::SwitchPage( sal_Int16 nNewStep )
disableControl( TKGet( TK_btnNavBack ) );
else if ( nOldStep == 0 )
enableControl( TKGet( TK_btnNavBack ) );
-
+
if ( nNewStep == MAX_STEP )
disableControl( TKGet( TK_btnNavNext ) );
else if ( nOldStep == MAX_STEP )
enableControl( TKGet( TK_btnNavNext ) );
setControlProperty( TKGet( TK_rdmNavi ), TKGet( TK_CurrentItemID ), Any( nNewStep ) );
-
+
DeactivatePage( nOldStep );
UpdateControlStates( nNewStep );
@@ -523,12 +522,12 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
{
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 );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("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 );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("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 );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("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 );
@@ -541,16 +540,16 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
aLoadProps[ 1 ].Name = TKGet( TK_InputStream );
aLoadProps[ 1 ].Value <<= xInputStream;
- Reference< XComponent >( xLoader->loadComponentFromURL( OUString::createFromAscii( "private:stream" ),
+ Reference< XComponent >( xLoader->loadComponentFromURL( OUString(RTL_CONSTASCII_USTRINGPARAM("private:stream")),
TKGet( TK__self ), 0, aLoadProps ) );
Reference< XPropertySet > xPropSet( xHelpFrame, UNO_QUERY_THROW );
Reference< XLayoutManager > xLayoutManager;
- if ( xPropSet->getPropertyValue( OUString::createFromAscii( "LayoutManager" ) ) >>= xLayoutManager )
+ if ( xPropSet->getPropertyValue( OUString(RTL_CONSTASCII_USTRINGPARAM("LayoutManager")) ) >>= xLayoutManager )
{
- xLayoutManager->setVisible( sal_False );
- xLayoutManager->hideElement( OUString::createFromAscii( "private:resource/menubar/menubar" ) );
- xLayoutManager->destroyElement( OUString::createFromAscii( "private:resource/statusbar/statusbar" ) );
+ xLayoutManager->setVisible( sal_False );
+ xLayoutManager->hideElement( OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/menubar/menubar")) );
+ xLayoutManager->destroyElement( OUString(RTL_CONSTASCII_USTRINGPARAM("private:resource/statusbar/statusbar")) );
}
}
}
@@ -561,7 +560,7 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
}
break;
case TK_btnNavBack : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep - 1 ); break;
- case TK_btnNavNext : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep + 1 ); break;
+ case TK_btnNavNext : mrOptimizerDialog.SwitchPage( mrOptimizerDialog.mnCurrentStep + 1 ); break;
case TK_btnNavFinish :
{
mrOptimizerDialog.UpdateConfiguration();
@@ -575,7 +574,7 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
mrOptimizerDialog.setControlProperty( TKGet( TK_btnNavCancel ), TKGet( TK_Enabled ), Any( sal_False ) );
mrOptimizerDialog.setControlProperty( TKGet( TK_FixedText0Pg4 ), TKGet( TK_Enabled ), Any( sal_True ) );
- // check if we have to open the FileDialog
+ // 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;
@@ -603,7 +602,7 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
aLocation = aLocation.copy( 0, nIndex );
// adding .mini
- aLocation = aLocation.concat( OUString::createFromAscii( ".mini" ) );
+ aLocation = aLocation.concat( OUString(RTL_CONSTASCII_USTRINGPARAM(".mini")) );
aFileOpenDialog.setDefaultName( aLocation );
}
}
@@ -653,7 +652,7 @@ void ActionListener::actionPerformed( const ActionEvent& rEvent )
aArgs[ 0 ] <<= mrOptimizerDialog.GetFrame();
Reference < XDispatch > xDispatch( mrOptimizerDialog.GetComponentContext()->getServiceManager()->createInstanceWithArgumentsAndContext(
- OUString::createFromAscii( "com.sun.star.comp.PPPOptimizer" ), aArgs, mrOptimizerDialog.GetComponentContext() ), UNO_QUERY );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.PPPOptimizer")), aArgs, mrOptimizerDialog.GetComponentContext() ), UNO_QUERY );
URL aURL;
aURL.Protocol = OUString( RTL_CONSTASCII_USTRINGPARAM( "vnd.com.sun.star.comp.PPPOptimizer:" ) );
@@ -782,7 +781,7 @@ void SpinListenerFormattedField0Pg1::up( const SpinEvent& /* rEvent */ )
fDouble += 9;
if ( fDouble > 100 )
fDouble = 100;
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
+ mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)fDouble ) );
}
}
@@ -796,20 +795,20 @@ void SpinListenerFormattedField0Pg1::down( const SpinEvent& /* rEvent */ )
fDouble -= 9;
if ( fDouble < 0 )
fDouble = 0;
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
+ mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( fDouble ) );
mrOptimizerDialog.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.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 */ )
throw ( com::sun::star::uno::RuntimeException )
{
- mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 100 ) ) );
+ mrOptimizerDialog.setControlProperty( TKGet( TK_FormattedField0Pg1 ), TKGet( TK_EffectiveValue ), Any( static_cast< double >( 100 ) ) );
mrOptimizerDialog.SetConfigProperty( TK_JPEGQuality, Any( (sal_Int32)100 ) );
}
void SpinListenerFormattedField0Pg1::disposing( const ::com::sun::star::lang::EventObject& /* Source */ )
@@ -837,3 +836,5 @@ void HelpCloseListener::disposing( const EventObject& ) throw ( RuntimeException
{
mrXFrame = NULL;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */