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/26 13:56:58 UTC
svn commit: r1461102 [4/4] - 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/optimizerdialogcontrols.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/optimizerdialogcontrols.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/optimizerdialogcontrols.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/optimizerdialogcontrols.cxx Tue Mar 26 12:56:56 2013
@@ -25,8 +25,6 @@
#include "precompiled_sdext.hxx"
#include "optimizerdialog.hxx"
-#include "minimizer.hrc"
-#include "helpid.hrc"
// -------------------
// - OptimizerDialog -
@@ -43,6 +41,7 @@
#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;
@@ -54,29 +53,22 @@ using namespace ::com::sun::star::drawin
using namespace ::com::sun::star::container;
using namespace ::com::sun::star::presentation;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
// -----------------------------------------------------------------------------
-void OptimizerDialog::ImplSetBold( const rtl::OUString& rControl )
+void SetBold( OptimizerDialog& rOptimizerDialog, const rtl::OUString& rControl )
{
FontDescriptor aFontDescriptor;
- if ( getControlProperty( rControl, TKGet( TK_FontDescriptor ) ) >>= aFontDescriptor )
+ if ( rOptimizerDialog.getControlProperty( rControl, TKGet( TK_FontDescriptor ) ) >>= aFontDescriptor )
{
aFontDescriptor.Weight = FontWeight::BOLD;
- setControlProperty( rControl, TKGet( TK_FontDescriptor ), Any( aFontDescriptor ) );
+ rOptimizerDialog.setControlProperty( rControl, TKGet( TK_FontDescriptor ), Any( aFontDescriptor ) );
}
}
// -----------------------------------------------------------------------------
-rtl::OUString OptimizerDialog::ImplInsertSeparator(
- const OUString& rControlName,
- sal_Int32 nOrientation,
- sal_Int32 nPosX,
- sal_Int32 nPosY,
- sal_Int32 nWidth,
- sal_Int32 nHeight )
+rtl::OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, sal_Int32 nOrientation,
+ sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight )
{
OUString pNames[] = {
TKGet( TK_Height ),
@@ -99,29 +91,19 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ),
+ rOptimizerDialog.insertControlModel( OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.UnoControlFixedLineModel" ) ),
rControlName, aNames, aValues );
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
OUString pNames[] = {
TKGet( TK_Enabled ),
TKGet( TK_Height ),
- TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -133,8 +115,7 @@ rtl::OUString OptimizerDialog::ImplInser
Any pValues[] = {
Any( bEnabled ),
Any( nHeight ),
- Any( rHelpURL ),
- Any( getString( nResID ) ),
+ Any( rOptimizerDialog.getString( nResID ) ),
Any( nXPos ),
Any( nYPos ),
Any( nPushButtonType ),
@@ -148,22 +129,14 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- insertButton( rControlName, this, aNames, aValues );
+ rOptimizerDialog.insertButton( rControlName, xActionListener, aNames, aValues );
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
OUString pNames[] = {
TKGet( TK_Height ),
@@ -190,28 +163,21 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- insertFixedText( rControlName, aNames, aValues );
+ rOptimizerDialog.insertFixedText( rControlName, aNames, aValues );
if ( bBold )
- ImplSetBold( rControlName );
+ SetBold( rOptimizerDialog, rControlName );
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
OUString pNames[] = {
TKGet( TK_Enabled ),
TKGet( TK_Height ),
- TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -222,7 +188,6 @@ rtl::OUString OptimizerDialog::ImplInser
Any pValues[] = {
Any( sal_True ),
Any( nHeight ),
- Any( rHelpURL ),
Any( rLabel ),
Any( nXPos ),
Any( nYPos ),
@@ -235,29 +200,23 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XCheckBox > xCheckBox( insertCheckBox( rControlName, aNames, aValues ) );
- xCheckBox->addItemListener( this );
+ Reference< XCheckBox > xCheckBox( rOptimizerDialog.insertCheckBox( rControlName, aNames, aValues ) );
+ if ( xItemListener.is() )
+ xCheckBox->addItemListener( xItemListener );
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
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 ),
@@ -271,7 +230,6 @@ rtl::OUString OptimizerDialog::ImplInser
Any( fEffectiveMin ),
Any( sal_True ),
Any( (sal_Int32)12 ),
- Any( rHelpURL ),
Any( nXPos ),
Any( nYPos ),
Any( (sal_Bool)sal_True ),
@@ -285,33 +243,27 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XTextComponent > xTextComponent( insertFormattedField( rControlName, aNames, aValues ), UNO_QUERY_THROW );
- xTextComponent->addTextListener( this );
- Reference< XSpinField > xSpinField( xTextComponent, UNO_QUERY_THROW );
- xSpinField->addSpinListener( this );
-
+ 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 );
+ }
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
OUString pNames[] = {
TKGet( TK_Dropdown ),
TKGet( TK_Enabled ),
TKGet( TK_Height ),
- TKGet( TK_HelpURL ),
TKGet( TK_LineCount ),
TKGet( TK_PositionX ),
TKGet( TK_PositionY ),
@@ -324,7 +276,6 @@ rtl::OUString OptimizerDialog::ImplInser
Any( sal_True ),
Any( bEnabled ),
Any( nHeight ),
- Any( rHelpURL ),
Any( (sal_Int16)8),
Any( nXPos ),
Any( nYPos ),
@@ -338,28 +289,19 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XTextComponent > xTextComponent( insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW );
- if ( bListen )
- xTextComponent->addTextListener( this );
+ Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW );
+ if ( xTextListener.is() )
+ xTextComponent->addTextListener( xTextListener );
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
OUString pNames[] = {
TKGet( TK_Height ),
- TKGet( TK_HelpURL ),
TKGet( TK_Label ),
TKGet( TK_MultiLine ),
TKGet( TK_PositionX ),
@@ -370,7 +312,6 @@ rtl::OUString OptimizerDialog::ImplInser
Any pValues[] = {
Any( nHeight ),
- Any( rHelpURL ),
Any( rLabel ),
Any( bMultiLine ),
Any( nXPos ),
@@ -384,29 +325,22 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XRadioButton > xRadioButton( insertRadioButton( rControlName, aNames, aValues ) );
- xRadioButton->addItemListener( this );
+ Reference< XRadioButton > xRadioButton( rOptimizerDialog.insertRadioButton( rControlName, aNames, aValues ) );
+ if ( xItemListener.is() )
+ xRadioButton->addItemListener( xItemListener );
return rControlName;
}
// -----------------------------------------------------------------------------
-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 )
+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 )
{
OUString pNames[] = {
TKGet( TK_Dropdown ),
TKGet( TK_Enabled ),
TKGet( TK_Height ),
- TKGet( TK_HelpURL ),
TKGet( TK_LineCount ),
TKGet( TK_MultiSelection ),
TKGet( TK_PositionX ),
@@ -420,7 +354,6 @@ rtl::OUString OptimizerDialog::ImplInser
Any( sal_True ),
Any( bEnabled ),
Any( nHeight ),
- Any( rHelpURL ),
Any( (sal_Int16)8),
Any( sal_False ),
Any( nXPos ),
@@ -435,8 +368,9 @@ rtl::OUString OptimizerDialog::ImplInser
Sequence< rtl::OUString > aNames( pNames, nCount );
Sequence< Any > aValues( pValues, nCount );
- Reference< XListBox > xListBox( insertListBox( rControlName, aNames, aValues ) );
- xListBox->addActionListener( this );
+ Reference< XListBox > xListBox( rOptimizerDialog.insertListBox( rControlName, aNames, aValues ) );
+ if ( xListBox.is() )
+ xListBox->addActionListener( xActionListener );
return rControlName;
}
@@ -449,14 +383,14 @@ void OptimizerDialog::InitNavigationBar(
sal_Int32 nNextPosX = nFinishPosX - 6 - BUTTON_WIDTH;
sal_Int32 nBackPosX = nNextPosX - 3 - BUTTON_WIDTH;
- 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 );
+ 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 );
- 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 );
+ 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 );
setControlProperty( TKGet( TK_btnNavNext ), TKGet( TK_DefaultButton ), Any( sal_True ) );
}
@@ -499,12 +433,12 @@ void OptimizerDialog::InitPage0()
{
Sequence< OUString > aItemList;
std::vector< rtl::OUString > aControlList;
- 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 ) );
+ 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 ) );
maControlPages.push_back( aControlList );
DeactivatePage( 0 );
UpdateControlStatesPage0();
@@ -525,7 +459,7 @@ void OptimizerDialog::UpdateControlState
void OptimizerDialog::InitPage1()
{
Sequence< OUString > aCustomShowList;
- Reference< XModel > xModel( mxModel );
+ Reference< XModel > xModel( mxController->getModel() );
if ( xModel.is() )
{
Reference< XCustomPresentationSupplier > aXCPSup( xModel, UNO_QUERY_THROW );
@@ -534,12 +468,12 @@ void OptimizerDialog::InitPage1()
aCustomShowList = aXCont->getElementNames();
}
std::vector< rtl::OUString > aControlList;
- 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++ ) );
+ 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++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 1 );
@@ -601,15 +535,15 @@ void OptimizerDialog::InitPage2()
aResolutionItemList[ 3 ] = getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';', nI3 );
std::vector< rtl::OUString > aControlList;
- 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++ ) );
+ 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++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 2 );
UpdateControlStatesPage2();
@@ -631,7 +565,7 @@ void OptimizerDialog::UpdateControlState
void OptimizerDialog::InitPage3()
{
int nOLECount = 0;
- Reference< XModel > xModel( mxModel );
+ Reference< XModel > xModel( mxController->getModel() );
Reference< XDrawPagesSupplier > xDrawPagesSupplier( xModel, UNO_QUERY_THROW );
Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
@@ -647,11 +581,11 @@ void OptimizerDialog::InitPage3()
}
std::vector< rtl::OUString > aControlList;
- 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++ ) );
+ 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++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 3 );
UpdateControlStatesPage3();
@@ -749,7 +683,7 @@ void OptimizerDialog::UpdateControlState
if ( aCustomShowName.getLength() )
{
std::vector< Reference< XDrawPage > > vNonUsedPageList;
- PageCollector::CollectNonCustomShowPages( mxModel, aCustomShowName, vNonUsedPageList );
+ PageCollector::CollectNonCustomShowPages( mxController->getModel(), aCustomShowName, vNonUsedPageList );
nDeletedSlides += vNonUsedPageList.size();
}
if ( GetConfigProperty( TK_DeleteHiddenSlides, sal_False ) )
@@ -757,7 +691,7 @@ void OptimizerDialog::UpdateControlState
if ( aCustomShowName.getLength() )
{
std::vector< Reference< XDrawPage > > vUsedPageList;
- PageCollector::CollectCustomShowPages( mxModel, aCustomShowName, vUsedPageList );
+ PageCollector::CollectCustomShowPages( mxController->getModel(), aCustomShowName, vUsedPageList );
std::vector< Reference< XDrawPage > >::iterator aIter( vUsedPageList.begin() );
while( aIter != vUsedPageList.end() )
{
@@ -774,7 +708,7 @@ void OptimizerDialog::UpdateControlState
}
else
{
- Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxModel, UNO_QUERY_THROW );
+ Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
for( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
{
@@ -794,8 +728,8 @@ void OptimizerDialog::UpdateControlState
if ( GetConfigProperty( TK_DeleteUnusedMasterPages, sal_False ) )
{
std::vector< PageCollector::MasterPageEntity > aMasterPageList;
- PageCollector::CollectMasterPages( mxModel, aMasterPageList );
- Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxModel, UNO_QUERY_THROW );
+ PageCollector::CollectMasterPages( mxController->getModel(), aMasterPageList );
+ Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_QUERY_THROW );
std::vector< PageCollector::MasterPageEntity >::iterator aIter( aMasterPageList.begin() );
while( aIter != aMasterPageList.end() )
@@ -822,7 +756,7 @@ void OptimizerDialog::UpdateControlState
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( mxContext, mxModel, aGraphicSettings, nGraphics );
+ GraphicCollector::CountGraphics( mxMSF, mxController->getModel(), aGraphicSettings, nGraphics );
if ( nGraphics > 1 )
{
OUString aStr( getString( STR_OPTIMIZE_IMAGES ) );
@@ -847,7 +781,7 @@ void OptimizerDialog::UpdateControlState
if ( GetConfigProperty( TK_OLEOptimization, sal_False ) )
{
sal_Int32 nOLEReplacements = 0;
- Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxModel, UNO_QUERY_THROW );
+ Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_QUERY_THROW );
for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
{
@@ -878,7 +812,7 @@ void OptimizerDialog::UpdateControlState
sal_Int64 nCurrentFileSize = 0;
sal_Int64 nEstimatedFileSize = 0;
- Reference< XStorable > xStorable( mxModel, UNO_QUERY );
+ Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY );
if ( xStorable.is() && xStorable->hasLocation() )
nCurrentFileSize = PPPOptimizer::GetFileSize( xStorable->getLocation() );
@@ -922,7 +856,7 @@ void OptimizerDialog::InitPage4()
Any pValues[] = {
Any( (sal_Int32)12 ),
- Any( OUString( RTL_CONSTASCII_USTRINGPARAM("STR_SAVE_AS") ) ),//TODO
+ Any( TKGet( STR_SAVE_AS ) ),
Any( (sal_Int32)( PAGE_POS_X + 6 ) ),
Any( (sal_Int32)( DIALOG_HEIGHT - 75 ) ),
Any( (sal_Int32)( 0 ) ),
@@ -938,35 +872,30 @@ 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( 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_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_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_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_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++ ) );
+ 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++ ) );
setControlProperty( TKGet( TK_FixedText7Pg4 ), TKGet( TK_Align ), Any( static_cast< short >( 2 ) ) );
- 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++ ) );
+ 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++ ) );
setControlProperty( TKGet( TK_FixedText8Pg4 ), TKGet( TK_Align ), Any( static_cast< short >( 2 ) ) );
- 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( 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( TKGet( TK_Progress ) );
- 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) );
+ 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++ ) );
maControlPages.push_back( aControlList );
DeactivatePage( 4 );
Modified: openoffice/trunk/main/sdext/source/minimizer/pagecollector.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pagecollector.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pagecollector.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pagecollector.cxx Tue Mar 26 12:56:56 2013
@@ -33,6 +33,7 @@
#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;
@@ -42,8 +43,6 @@ 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
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.cxx Tue Mar 26 12:56:56 2013
@@ -30,32 +30,28 @@
#include <com/sun/star/lang/IllegalArgumentException.hpp>
-#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer"
-
-
+using namespace ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
-using ::rtl::OUString;
+#define SERVICE_NAME "com.sun.star.comp.PPPOptimizer"
// ----------------
// - PPPOptimizer -
// ----------------
-PPPOptimizer::PPPOptimizer( const Reference< XComponentContext > &rxContext ) :
- mxContext( rxContext )
+PPPOptimizer::PPPOptimizer( const Reference< XComponentContext > &rxMSF ) :
+ mxMSF( rxMSF )
{
- OSL_TRACE("PPPOptimizer::PPPOptimizer");
}
// -----------------------------------------------------------------------------
PPPOptimizer::~PPPOptimizer()
{
- OSL_TRACE("PPPOptimizer::~PPPOptimizer");
}
// -----------------------------------------------------------------------------
@@ -65,7 +61,6 @@ PPPOptimizer::~PPPOptimizer()
void SAL_CALL PPPOptimizer::initialize( const Sequence< Any >& aArguments )
throw ( Exception, RuntimeException )
{
- OSL_TRACE("PPPOptimizer::initialize");
if( aArguments.getLength() != 1 )
throw IllegalArgumentException();
@@ -135,7 +130,6 @@ Sequence< Reference< com::sun::star::fra
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 )
@@ -145,7 +139,7 @@ void SAL_CALL PPPOptimizer::dispatch( co
{
try
{
- ImpOptimizer aOptimizer( mxContext, xModel );
+ ImpOptimizer aOptimizer( mxMSF, xModel );
aOptimizer.Optimize( lArguments );
}
catch( Exception& )
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.hxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizer.hxx Tue Mar 26 12:56:56 2013
@@ -43,12 +43,12 @@ class PPPOptimizer : public cppu::WeakIm
com::sun::star::frame::XDispatchProvider,
com::sun::star::frame::XDispatch >
{
- com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxContext;
+ com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxMSF;
com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController;
public:
- PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
+ PPPOptimizer( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF );
virtual ~PPPOptimizer();
// XInitialization
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.cxx Tue Mar 26 12:56:56 2013
@@ -27,40 +27,30 @@
#include "pppoptimizerdialog.hxx"
#include "optimizerdialog.hxx"
-#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 ::rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
-using ::rtl::OUString;
-using ::com::sun::star::awt::XWindow;
-using ::com::sun::star::awt::XWindowPeer;
+#define SERVICE_NAME "com.sun.star.comp.SunPresentationMinimizer"
+#include <rtl/ustrbuf.hxx>
// ----------------------
// - PPPOptimizerDialog -
// ----------------------
-PPPOptimizerDialog::PPPOptimizerDialog(
- const Reference< XComponentContext > &rxContext )
- : m_xContext( rxContext )
- , mbInitialized( false )
+PPPOptimizerDialog::PPPOptimizerDialog( const Reference< XComponentContext > &rxMSF ) :
+ mxMSF( rxMSF ),
+ mpOptimizerDialog( NULL )
{
- OSL_TRACE("PPPOptimizerDialog::PPPOptimizerDialog");
}
// -----------------------------------------------------------------------------
PPPOptimizerDialog::~PPPOptimizerDialog()
{
- OSL_TRACE("PPPOptimizerDialog::~PPPOptimizerDialog");
}
// -----------------------------------------------------------------------------
@@ -70,60 +60,12 @@ PPPOptimizerDialog::~PPPOptimizerDialog(
void SAL_CALL PPPOptimizerDialog::initialize( const Sequence< Any >& aArguments )
throw ( Exception, RuntimeException )
{
- 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;
- }
-
- 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();
+ if( aArguments.getLength() != 1 )
+ throw IllegalArgumentException();
+
+ aArguments[ 0 ] >>= mxFrame;
+ if ( mxFrame.is() )
+ mxController = mxFrame->getController();
}
// -----------------------------------------------------------------------------
@@ -148,48 +90,110 @@ Sequence< OUString > SAL_CALL PPPOptimiz
return PPPOptimizerDialog_getSupportedServiceNames();
}
+// -----------------------------------------------------------------------------
+// XDispatchProvider
+// -----------------------------------------------------------------------------
-void SAL_CALL PPPOptimizerDialog::setTitle( const ::rtl::OUString& aTitle )
-throw (::com::sun::star::uno::RuntimeException)
+Reference< com::sun::star::frame::XDispatch > SAL_CALL PPPOptimizerDialog::queryDispatch(
+ const URL& aURL, const ::rtl::OUString& /* aTargetFrameName */, sal_Int32 /* nSearchFlags */ ) throw( RuntimeException )
{
- osl::MutexGuard aGuard( m_aMutex );
- msTitle = aTitle;
+ Reference < XDispatch > xRet;
+ if ( aURL.Protocol.compareToAscii( "vnd.com.sun.star.comp.SunPresentationMinimizer:" ) == 0 )
+ xRet = this;
+
+ return xRet;
}
-::sal_Int16 SAL_CALL PPPOptimizerDialog::execute( )
-throw (::com::sun::star::uno::RuntimeException)
-{
- 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
- {
- OptimizerDialog *pDialog(
- new OptimizerDialog( m_xContext, xFrame, xParent ) );
- pDialog->setTitle( msTitle );
- aRet = pDialog->execute();
- delete pDialog;
- }
- catch( ... )
- {
- }
+//------------------------------------------------------------------------------
- return aRet;
+Sequence< Reference< com::sun::star::frame::XDispatch > > SAL_CALL PPPOptimizerDialog::queryDispatches(
+ const Sequence< com::sun::star::frame::DispatchDescriptor >& aDescripts ) throw( 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 )
+ {
+ *pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags );
+ }
+ 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 ) )
+ {
+ 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!" );
}
// -----------------------------------------------------------------------------
OUString PPPOptimizerDialog_getImplementationName()
{
- return OUString ( RTL_CONSTASCII_USTRINGPARAM ( IMPLEMENTATION_NAME ) );
+ return OUString ( RTL_CONSTASCII_USTRINGPARAM ( "com.sun.star.comp.SunPresentationMinimizerImp" ) );
}
Sequence< OUString > PPPOptimizerDialog_getSupportedServiceNames()
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.hxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizerdialog.hxx Tue Mar 26 12:56:56 2013
@@ -31,46 +31,41 @@
#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 <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/awt/XWindowPeer.hpp>
-
-#include <cppuhelper/implbase3.hxx>
-#include <cppuhelper/basemutex.hxx>
+#include <cppuhelper/implbase4.hxx>
// ----------------------
// - PPPOptimizerDialog -
// ----------------------
-class PPPOptimizerDialog : protected ::cppu::BaseMutex,
- public ::cppu::WeakImplHelper3<
+class OptimizerDialog;
+class PPPOptimizerDialog : public ::cppu::WeakImplHelper4<
com::sun::star::lang::XInitialization,
com::sun::star::lang::XServiceInfo,
- com::sun::star::ui::dialogs::XExecutableDialog >
+ com::sun::star::frame::XDispatchProvider,
+ com::sun::star::frame::XDispatch >
{
-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::awt::XWindowPeer > mxParentWindow;
- rtl::OUString msTitle;
+ 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::XController > mxController;
+
+ OptimizerDialog* mpOptimizerDialog;
public:
- PPPOptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxContext );
+ PPPOptimizerDialog( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rxMSF );
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 );
@@ -80,6 +75,26 @@ 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();
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.cxx Tue Mar 26 12:56:56 2013
@@ -49,7 +49,7 @@ struct TokenTable
const char* pS;
PPPOptimizerTokenEnum pE;
};
-
+
static const TokenTable pTokenTableArray[] =
{
{ "rdmNavi", TK_rdmNavi },
@@ -112,6 +112,7 @@ 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 },
@@ -145,11 +146,11 @@ static const TokenTable pTokenTableArray
{ "GraphicURL", TK_GraphicURL },
{ "GraphicStreamURL", TK_GraphicStreamURL },
{ "Height", TK_Height },
- { "HelpURL", TK_HelpURL },
+ { "HelpFile", TK_HelpFile },
{ "Hidden", TK_Hidden },
{ "ID", TK_ID },
{ "ImageURL", TK_ImageURL },
- { "ParentWindow", TK_ParentWindow },// TODO move it
+ { "InformationDialog", TK_InformationDialog },
{ "InputStream", TK_InputStream },
{ "Interlaced", TK_Interlaced },
{ "IsInternal", TK_IsInternal },
@@ -185,7 +186,7 @@ static const TokenTable pTokenTableArray
{ "Spin", TK_Spin },
{ "Step", TK_Step },
{ "State", TK_State },
- { "StatusListener", TK_StatusListener },
+ { "StatusDispatcher", TK_StatusDispatcher },
{ "StringItemList", TK_StringItemList },
{ "Strings", TK_Strings },
{ "TabIndex", TK_TabIndex },
@@ -225,8 +226,8 @@ static const TokenTable pTokenTableArray
{ "CurrentGraphicObject",TK_CurrentGraphicObject },
{ "OLEObjects", TK_OLEObjects },
{ "CurrentOLEObject", TK_CurrentOLEObject },
-#if 0
- { "STR_PRESENTATION_MINIMIZER",STR_PRESENTATION_MINIMIZER },
+
+ { "STR_SUN_OPTIMIZATION_WIZARD2",STR_SUN_OPTIMIZATION_WIZARD2 },
{ "STR_STEPS", STR_STEPS },
{ "STR_HELP", STR_HELP },
{ "STR_BACK", STR_BACK },
@@ -291,7 +292,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 }
};
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.hxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizertoken.hxx Tue Mar 26 12:56:56 2013
@@ -88,6 +88,7 @@ enum PPPOptimizerTokenEnum
TK_Alpha,
TK_Animated,
TK_Background,
+ TK_BitmapPath,
TK_Border,
TK_Closeable,
TK_ColorMode,
@@ -121,11 +122,11 @@ enum PPPOptimizerTokenEnum
TK_GraphicURL,
TK_GraphicStreamURL,
TK_Height,
- TK_HelpURL,
+ TK_HelpFile,
TK_Hidden,
TK_ID,
TK_ImageURL,
- TK_ParentWindow,
+ TK_InformationDialog,
TK_InputStream,
TK_Interlaced,
TK_IsInternal,
@@ -161,7 +162,7 @@ enum PPPOptimizerTokenEnum
TK_Spin,
TK_Step,
TK_State,
- TK_StatusListener,
+ TK_StatusDispatcher,
TK_StringItemList,
TK_Strings,
TK_TabIndex,
@@ -201,8 +202,8 @@ enum PPPOptimizerTokenEnum
TK_CurrentGraphicObject,
TK_OLEObjects,
TK_CurrentOLEObject,
-#if 0
- STR_PRESENTATION_MINIMIZER,
+
+ STR_SUN_OPTIMIZATION_WIZARD2,
STR_STEPS,
STR_HELP,
STR_BACK,
@@ -267,7 +268,7 @@ enum PPPOptimizerTokenEnum
STR_OPTIMIZING_GRAPHICS,
STR_CREATING_OLE_REPLACEMENTS,
STR_FILESIZESEPARATOR,
-#endif
+
TK_Last,
TK_NotFound
};
Modified: openoffice/trunk/main/sdext/source/minimizer/pppoptimizeruno.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/pppoptimizeruno.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/pppoptimizeruno.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/pppoptimizeruno.cxx Tue Mar 26 12:56:56 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,66 +7,110 @@
* 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 "pppoptimizer.hxx"
-#include "pppoptimizerdialog.hxx"
-
+#include <stdio.h>
+#include <osl/mutex.hxx>
+#include <osl/thread.h>
#include <cppuhelper/factory.hxx>
-#include <cppuhelper/implementationentry.hxx>
+#include <pppoptimizer.hxx>
+#include <pppoptimizerdialog.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;
-namespace sdext_presentation_minimizer
+extern "C"
{
- static struct cppu::ImplementationEntry g_entries[] =
+ void SAL_CALL component_getImplementationEnvironment(
+ const sal_Char ** ppEnvTypeName, uno_Environment ** )
{
- {
- 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 }
- };
-}
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ }
-extern "C"
-{
- SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
- const sal_Char **ppEnvTypeName, uno_Environment **/*ppEnv*/ )
+ // -------------------------------------------------------------------------
+
+ sal_Bool SAL_CALL component_writeInfo( void* /*pServiceManager*/, void* pRegistryKey )
{
- *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+ 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] );
+
+ return sal_True;
+ }
+ catch (InvalidRegistryException &)
+ {
+ OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+ }
+ }
+ return sal_False;
}
- SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory(
- const sal_Char *pImplName, void *pServiceManager, void *pRegistryKey )
+ // -------------------------------------------------------------------------
+
+ void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
{
- return ::cppu::component_getFactoryHelper( pImplName,
- pServiceManager,
- pRegistryKey ,
- sdext_presentation_minimizer::g_entries );
+ 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;
}
}
Modified: openoffice/trunk/main/sdext/source/minimizer/unodialog.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/unodialog.cxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/unodialog.cxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/unodialog.cxx Tue Mar 26 12:56:56 2013
@@ -25,23 +25,20 @@
#include "precompiled_sdext.hxx"
#include "unodialog.hxx"
-
-#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/drawing/XShapes.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
#include <com/sun/star/text/XTextRange.hpp>
-#include <com/sun/star/view/XControlAccess.hpp>
+#include <com/sun/star/drawing/XShapes.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/frame/XDispatch.hpp>
+#include <com/sun/star/awt/XMessageBoxFactory.hpp>
+#include <com/sun/star/awt/MessageBoxButtons.hpp>
// -------------
// - UnoDialog -
// -------------
+using namespace ::rtl;
using namespace ::com::sun::star::awt;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::util;
@@ -51,58 +48,44 @@ using namespace ::com::sun::star::frame;
using namespace ::com::sun::star::beans;
using namespace ::com::sun::star::script;
-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 ),
+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 ),
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( mxContext->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.awt.UnoControlDialog" ) ), mxContext ), UNO_QUERY_THROW ),
+ mxDialog( mxMSF->getServiceManager()->createInstanceWithContext( OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.awt.UnoControlDialog" ) ), mxMSF ), 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 );
- mxDialogWindow = Reference< XWindow >( mxDialog, UNO_QUERY );
- mxDialogWindowPeer = createWindowPeer();
+ 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 );
}
// -----------------------------------------------------------------------------
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();
@@ -110,55 +93,22 @@ 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 > UnoDialog::createWindowPeer( Reference< XWindowPeer > xParentPeer )
throw ( Exception )
{
- mxDialogWindow->setVisible( sal_False );
-
- // 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 );
-
+ 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();
mxReschedule = Reference< XReschedule >( xToolkit, UNO_QUERY );
- mxControl->createPeer( xToolkit, mxParent );
-
+ mxControl->createPeer( xToolkit, xParentPeer );
+// xWindowPeer = xControl.getPeer();
return mxControl->getPeer();
}
@@ -203,9 +153,14 @@ sal_Bool UnoDialog::isHighContrast()
sal_Bool bHighContrast = sal_False;
try
{
- Reference< XStyleSettingsSupplier > xStyleSettingsSuppl( mxDialogWindow, UNO_QUERY_THROW );
- Reference< XStyleSettings > xStyleSettings( xStyleSettingsSuppl->getStyleSettings() );
- bHighContrast = xStyleSettings->getHighContrastMode();
+ 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;
+ }
}
catch( Exception& )
{
Modified: openoffice/trunk/main/sdext/source/minimizer/unodialog.hxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/sdext/source/minimizer/unodialog.hxx?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/sdext/source/minimizer/unodialog.hxx (original)
+++ openoffice/trunk/main/sdext/source/minimizer/unodialog.hxx Tue Mar 26 12:56:56 2013
@@ -26,7 +26,9 @@
#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>
@@ -51,6 +53,9 @@
#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 -
@@ -62,24 +67,23 @@ class UnoDialog
{
public :
- 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();
+ 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();
- com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > createWindowPeer() throw ( com::sun::star::uno::Exception );
+ void execute();
+ void endExecute( sal_Bool bStatus );
+
+ 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::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,
@@ -108,13 +112,15 @@ protected:
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 );
-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::XComponentContext > mxMSF;
+ com::sun::star::uno::Reference< com::sun::star::frame::XController > mxController;
+ com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule;
com::sun::star::uno::Reference< com::sun::star::uno::XInterface > mxDialogModel;
com::sun::star::uno::Reference< com::sun::star::beans::XMultiPropertySet > mxDialogModelMultiPropertySet;
@@ -122,16 +128,18 @@ protected:
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;
- sal_Bool mbStatus;
+ com::sun::star::uno::Reference< com::sun::star::awt::XWindowPeer > mxWindowPeer;
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;
- com::sun::star::uno::Reference< com::sun::star::awt::XReschedule > mxReschedule;
+ sal_Bool mbStatus;
};
#endif // UNODIALOG_HXX
Modified: openoffice/trunk/main/set_soenv.in
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/set_soenv.in?rev=1461102&r1=1461101&r2=1461102&view=diff
==============================================================================
--- openoffice/trunk/main/set_soenv.in (original)
+++ openoffice/trunk/main/set_soenv.in Tue Mar 26 12:56:56 2013
@@ -1676,6 +1676,7 @@ ToFile( "ENABLE_CAIRO", "@ENABLE_CA
ToFile( "ENABLE_CAIRO_CANVAS", "@ENABLE_CAIRO_CANVAS@", "e" );
ToFile( "ENABLE_OPENGL", "@ENABLE_OPENGL@", "e" );
ToFile( "ENABLE_PDFIMPORT", "@ENABLE_PDFIMPORT@", "e" );
+ToFile( "ENABLE_MINIMIZER", "@ENABLE_MINIMIZER@","e" );
ToFile( "ENABLE_PRESENTER_SCREEN","@ENABLE_PRESENTER_SCREEN@","e" );
ToFile( "ENABLE_REPORTBUILDER","@ENABLE_REPORTBUILDER@","e" );
ToFile( "SYSTEM_JFREEREPORT","@SYSTEM_JFREEREPORT@","e" );