LibreOffice Module sdext (master)  1
optimizerdialogcontrols.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 
21 #include "optimizerdialog.hxx"
22 
23 
24 #include "pppoptimizer.hxx"
25 #include "graphiccollector.hxx"
26 #include "pagecollector.hxx"
27 #include <com/sun/star/awt/PushButtonType.hpp>
28 #include <com/sun/star/awt/XSpinField.hpp>
29 #include <com/sun/star/awt/XTextComponent.hpp>
30 #include <com/sun/star/presentation/XCustomPresentationSupplier.hpp>
31 #include <com/sun/star/drawing/XMasterPagesSupplier.hpp>
32 #include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
33 #include <com/sun/star/awt/FontDescriptor.hpp>
34 #include <com/sun/star/awt/FontWeight.hpp>
35 #include <com/sun/star/frame/XStorable.hpp>
36 #include <rtl/ustrbuf.hxx>
37 #include <sal/macros.h>
38 #include <o3tl/string_view.hxx>
39 
40 using namespace ::com::sun::star::awt;
41 using namespace ::com::sun::star::uno;
42 using namespace ::com::sun::star::util;
43 using namespace ::com::sun::star::lang;
44 using namespace ::com::sun::star::frame;
45 using namespace ::com::sun::star::beans;
46 using namespace ::com::sun::star::drawing;
47 using namespace ::com::sun::star::container;
48 using namespace ::com::sun::star::presentation;
49 
50 
51 static void SetBold( OptimizerDialog& rOptimizerDialog, const OUString& rControl )
52 {
53  FontDescriptor aFontDescriptor;
54  if ( rOptimizerDialog.getControlProperty( rControl, "FontDescriptor" ) >>= aFontDescriptor )
55  {
56  aFontDescriptor.Weight = com::sun::star::awt::FontWeight::BOLD;
57  rOptimizerDialog.setControlProperty( rControl, "FontDescriptor", Any( aFontDescriptor ) );
58  }
59 }
60 
61 
62 static OUString InsertSeparator( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, sal_Int32 nOrientation,
63  sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight )
64 {
65  OUString pNames[] = {
66  OUString("Height"),
67  OUString("Orientation"),
68  OUString("PositionX"),
69  OUString("PositionY"),
70  OUString("Step"),
71  OUString("Width") };
72 
73  Any pValues[] = {
74  Any( nHeight ),
75  Any( nOrientation ),
76  Any( nPosX ),
77  Any( nPosY ),
78  Any( sal_Int16( 0 ) ),
79  Any( nWidth ) };
80 
81  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
82 
83  Sequence< OUString > aNames( pNames, nCount );
84  Sequence< Any > aValues( pValues, nCount );
85 
86  rOptimizerDialog.insertControlModel( "com.sun.star.awt.UnoControlFixedLineModel",
87  rControlName, aNames, aValues );
88  return rControlName;
89 }
90 
91 
92 static OUString InsertButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, Reference< XActionListener > const & xActionListener,
93  sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex, bool bEnabled, PPPOptimizerTokenEnum nResID, css::awt::PushButtonType nPushButtonType )
94 {
95  sal_Int32 nHeight = BUTTON_HEIGHT;
96  OUString pNames[] = {
97  OUString("Enabled"),
98  OUString("Height"),
99  OUString("Label"),
100  OUString("PositionX"),
101  OUString("PositionY"),
102  OUString("PushButtonType"),
103  OUString("Step"),
104  OUString("TabIndex"),
105  OUString("Width") };
106 
107  Any pValues[] = {
108  Any( bEnabled ),
109  Any( nHeight ),
110  Any( rOptimizerDialog.getString( nResID ) ),
111  Any( nXPos ),
112  Any( nYPos ),
113  Any( static_cast< sal_Int16 >(nPushButtonType) ),
114  Any( sal_Int16(0) ),
115  Any( nTabIndex ),
116  Any( nWidth ) };
117 
118 
119  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
120 
121  Sequence< OUString > aNames( pNames, nCount );
122  Sequence< Any > aValues( pValues, nCount );
123 
124  rOptimizerDialog.insertButton( rControlName, xActionListener, aNames, aValues );
125  return rControlName;
126 }
127 
128 
129 static OUString InsertFixedText( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const OUString& rLabel,
130  sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, bool bMultiLine, bool bBold, sal_Int16 nTabIndex )
131 {
132  OUString pNames[] = {
133  OUString("Height"),
134  OUString("Label"),
135  OUString("MultiLine"),
136  OUString("PositionX"),
137  OUString("PositionY"),
138  OUString("Step"),
139  OUString("TabIndex"),
140  OUString("Width") };
141 
142  Any pValues[] = {
143  Any( nHeight ),
144  Any( rLabel ),
145  Any( bMultiLine ),
146  Any( nXPos ),
147  Any( nYPos ),
148  Any( sal_Int16(0) ),
149  Any( nTabIndex ),
150  Any( nWidth ) };
151 
152  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
153 
154  Sequence< OUString > aNames( pNames, nCount );
155  Sequence< Any > aValues( pValues, nCount );
156 
157  rOptimizerDialog.insertFixedText( rControlName, aNames, aValues );
158  if ( bBold )
159  SetBold( rOptimizerDialog, rControlName );
160  return rControlName;
161 }
162 
163 
164 static OUString InsertCheckBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
165  const Reference< XItemListener >& xItemListener, const OUString& rLabel,
166  sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex )
167 {
168  sal_Int32 nHeight = 8;
169  OUString pNames[] = {
170  OUString("Enabled"),
171  OUString("Height"),
172  OUString("Label"),
173  OUString("PositionX"),
174  OUString("PositionY"),
175  OUString("Step"),
176  OUString("TabIndex"),
177  OUString("Width") };
178 
179  Any pValues[] = {
180  Any( true ),
181  Any( nHeight ),
182  Any( rLabel ),
183  Any( nXPos ),
184  Any( nYPos ),
185  Any( sal_Int16(0) ),
186  Any( nTabIndex ),
187  Any( nWidth ) };
188 
189  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
190 
191  Sequence< OUString > aNames( pNames, nCount );
192  Sequence< Any > aValues( pValues, nCount );
193 
194  Reference< XCheckBox > xCheckBox( rOptimizerDialog.insertCheckBox( rControlName, aNames, aValues ) );
195  if ( xItemListener.is() )
196  xCheckBox->addItemListener( xItemListener );
197  return rControlName;
198 }
199 
200 
201 static OUString InsertFormattedField( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
202  const Reference< XTextListener >& xTextListener, const Reference< XSpinListener >& xSpinListener, sal_Int32 nXPos, sal_Int32 nYPos,
203  double fEffectiveMin, double fEffectiveMax, sal_Int16 nTabIndex )
204 {
205  sal_Int32 nWidth = 50;
206  OUString pNames[] = {
207  OUString("EffectiveMax"),
208  OUString("EffectiveMin"),
209  OUString("Enabled"),
210  OUString("Height"),
211  OUString("PositionX"),
212  OUString("PositionY"),
213  OUString("Repeat"),
214  OUString("Spin"),
215  OUString("Step"),
216  OUString("TabIndex"),
217  OUString("Width") };
218 
219  Any pValues[] = {
220  Any( fEffectiveMax ),
221  Any( fEffectiveMin ),
222  Any( true ),
223  Any( sal_Int32(12) ),
224  Any( nXPos ),
225  Any( nYPos ),
226  Any( true ),
227  Any( true ),
228  Any( sal_Int16(0) ),
229  Any( nTabIndex ),
230  Any( nWidth ) };
231 
232  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
233 
234  Sequence< OUString > aNames( pNames, nCount );
235  Sequence< Any > aValues( pValues, nCount );
236 
237  Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertFormattedField( rControlName, aNames, aValues ), UNO_QUERY_THROW );
238  if ( xTextListener.is() )
239  xTextComponent->addTextListener( xTextListener );
240  if ( xSpinListener.is() )
241  {
242  Reference< XSpinField > xSpinField( xTextComponent, UNO_QUERY_THROW );
243  xSpinField->addSpinListener( xSpinListener );
244  }
245  return rControlName;
246 }
247 
248 
249 static OUString InsertComboBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
250  const Reference< XTextListener >& rTextListener, const bool bEnabled, const Sequence< OUString >& rItemList,
251  sal_Int32 nXPos, sal_Int32 nYPos, sal_Int16 nTabIndex )
252 {
253  sal_Int32 nHeight = 12;
254  sal_Int32 nWidth = 100;
255  OUString pNames[] = {
256  OUString("Dropdown"),
257  OUString("Enabled"),
258  OUString("Height"),
259  OUString("LineCount"),
260  OUString("PositionX"),
261  OUString("PositionY"),
262  OUString("Step"),
263  OUString("StringItemList"),
264  OUString("TabIndex"),
265  OUString("Width") };
266 
267  Any pValues[] = {
268  Any( true ),
269  Any( bEnabled ),
270  Any( nHeight ),
271  Any( sal_Int16(8)),
272  Any( nXPos ),
273  Any( nYPos ),
274  Any( sal_Int16(0) ),
275  Any( rItemList ),
276  Any( nTabIndex ),
277  Any( nWidth ) };
278 
279  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
280 
281  Sequence< OUString > aNames( pNames, nCount );
282  Sequence< Any > aValues( pValues, nCount );
283 
284  Reference< XTextComponent > xTextComponent( rOptimizerDialog.insertComboBox( rControlName, aNames, aValues ), UNO_QUERY_THROW );
285  if ( rTextListener.is() )
286  xTextComponent->addTextListener( rTextListener );
287  return rControlName;
288 }
289 
290 
291 static OUString InsertRadioButton( OptimizerDialog& rOptimizerDialog, const OUString& rControlName, const Reference< XItemListener >& rItemListener,
292  const OUString& rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex )
293 {
294  sal_Int32 nHeight = 8;
295  OUString pNames[] = {
296  OUString("Height"),
297  OUString("Label"),
298  OUString("MultiLine"),
299  OUString("PositionX"),
300  OUString("PositionY"),
301  OUString("Step"),
302  OUString("TabIndex"),
303  OUString("Width") };
304 
305  Any pValues[] = {
306  Any( nHeight ),
307  Any( rLabel ),
308  Any( false ), // bMultiLine
309  Any( nXPos ),
310  Any( nYPos ),
311  Any( sal_Int16(0) ),
312  Any( nTabIndex ),
313  Any( nWidth ) };
314 
315  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
316 
317  Sequence< OUString > aNames( pNames, nCount );
318  Sequence< Any > aValues( pValues, nCount );
319 
320  Reference< XRadioButton > xRadioButton( rOptimizerDialog.insertRadioButton( rControlName, aNames, aValues ) );
321  if ( rItemListener.is() )
322  xRadioButton->addItemListener( rItemListener );
323  return rControlName;
324 }
325 
326 
327 static OUString InsertListBox( OptimizerDialog& rOptimizerDialog, const OUString& rControlName,
328  const Reference< XActionListener >& rActionListener, const bool bEnabled, const Sequence< OUString >& rItemList,
329  sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex )
330 {
331  sal_Int32 nHeight = 12;
332  OUString pNames[] = {
333  OUString("Dropdown"),
334  OUString("Enabled"),
335  OUString("Height"),
336  OUString("LineCount"),
337  OUString("MultiSelection"),
338  OUString("PositionX"),
339  OUString("PositionY"),
340  OUString("Step"),
341  OUString("StringItemList"),
342  OUString("TabIndex"),
343  OUString("Width") };
344 
345  Any pValues[] = {
346  Any( true ),
347  Any( bEnabled ),
348  Any( nHeight ),
349  Any( sal_Int16(8)),
350  Any( false ),
351  Any( nXPos ),
352  Any( nYPos ),
353  Any( sal_Int16(0) ),
354  Any( rItemList ),
355  Any( nTabIndex ),
356  Any( nWidth ) };
357 
358  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
359 
360  Sequence< OUString > aNames( pNames, nCount );
361  Sequence< Any > aValues( pValues, nCount );
362 
363  Reference< XListBox > xListBox( rOptimizerDialog.insertListBox( rControlName, aNames, aValues ) );
364  if ( xListBox.is() )
365  xListBox->addActionListener( rActionListener );
366  return rControlName;
367 }
368 
369 
371 {
372  sal_Int32 nCancelPosX = OD_DIALOG_WIDTH - BUTTON_WIDTH - 6;
373  sal_Int32 nFinishPosX = nCancelPosX - 6 - BUTTON_WIDTH;
374  sal_Int32 nNextPosX = nFinishPosX - 6 - BUTTON_WIDTH;
375  sal_Int32 nBackPosX = nNextPosX - 3 - BUTTON_WIDTH;
376 
377  InsertSeparator( *this, "lnNavSep1", 0, 0, DIALOG_HEIGHT - 26, OD_DIALOG_WIDTH, 1 );
378  InsertSeparator( *this, "lnNavSep2", 1, 85, 0, 1, BUTTON_POS_Y - 6 );
379 
380  InsertButton( *this, "btnNavBack", mxActionListener, nBackPosX, BUTTON_POS_Y, BUTTON_WIDTH, mnTabIndex++, false, STR_BACK, PushButtonType_STANDARD );
381  InsertButton( *this, "btnNavNext", mxActionListener, nNextPosX, BUTTON_POS_Y, BUTTON_WIDTH, mnTabIndex++, true, STR_NEXT, PushButtonType_STANDARD );
382  InsertButton( *this, "btnNavFinish", mxActionListener, nFinishPosX, BUTTON_POS_Y, BUTTON_WIDTH, mnTabIndex++, true, STR_FINISH, PushButtonType_STANDARD );
383  InsertButton( *this, "btnNavCancel", mxActionListener, nCancelPosX, BUTTON_POS_Y, BUTTON_WIDTH, mnTabIndex++, true, STR_CANCEL, PushButtonType_STANDARD );
384 
385  setControlProperty( "btnNavNext", "DefaultButton", Any( true ) );
386 }
387 
388 
390 {
391  short nSelectedItem = -1;
392  Sequence< OUString > aItemList;
393  const std::vector< OptimizerSettings >& rList( GetOptimizerSettings() );
394  if ( rList.size() > 1 ) // the first session in the list is the actual one -> skipping first one
395  {
396  aItemList.realloc( rList.size() - 1 );
397  auto pItemList = aItemList.getArray();
398  for ( std::vector<OptimizerSettings>::size_type i = 1; i < rList.size(); i++ )
399  {
400  pItemList[ i - 1 ] = rList[ i ].maName;
401  if ( nSelectedItem < 0 )
402  {
403  if ( rList[ i ] == rList[ 0 ] )
404  nSelectedItem = static_cast< short >( i - 1 );
405  }
406  }
407  }
408  bool bRemoveButtonEnabled = false;
409  Sequence< short > aSelectedItems;
410  if ( nSelectedItem >= 0 )
411  {
412  aSelectedItems = { nSelectedItem };
413  if ( nSelectedItem > 2 ) // only allowing to delete custom themes, the first can|t be deleted
414  bRemoveButtonEnabled = true;
415  }
416  setControlProperty( "ListBox0Pg0", "StringItemList", Any( aItemList ) );
417  setControlProperty( "ListBox0Pg0", "SelectedItems", Any( aSelectedItems ) );
418  setControlProperty( "Button0Pg0", "Enabled", Any( bRemoveButtonEnabled ) );
419 }
421 {
422  Sequence< OUString > aItemList;
423  std::vector< OUString > aControlList
424  {
425  InsertFixedText( *this, "FixedText0Pg0", getString( STR_INTRODUCTION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, false, true, mnTabIndex++ ),
426  InsertFixedText( *this, "FixedText1Pg0", getString( STR_INTRODUCTION_T ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 100, true, false, mnTabIndex++ ),
427  InsertSeparator( *this, "Separator1Pg0", 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 66, PAGE_WIDTH - 12, 1 ),
428  InsertFixedText( *this, "FixedText2Pg0", getString( STR_CHOSE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 60, PAGE_WIDTH - 12, 8, true, false, mnTabIndex++ ),
429  InsertListBox( *this, "ListBox0Pg0", mxActionListenerListBox0Pg0, true, aItemList, PAGE_POS_X + 6, DIALOG_HEIGHT - 48, ( OD_DIALOG_WIDTH - 50 ) - ( PAGE_POS_X + 6 ), mnTabIndex++ ),
430  InsertButton( *this, "Button0Pg0", mxActionListener, OD_DIALOG_WIDTH - 46, DIALOG_HEIGHT - 49, 40, mnTabIndex++, true, STR_REMOVE, PushButtonType_STANDARD )
431  };
432  maControlPages.push_back( aControlList );
433  DeactivatePage( 0 );
435 }
436 
437 
439 {
440  bool bDeleteUnusedMasterPages( GetConfigProperty( TK_DeleteUnusedMasterPages, false ) );
441  bool bDeleteHiddenSlides( GetConfigProperty( TK_DeleteHiddenSlides, false ) );
442  bool bDeleteNotesPages( GetConfigProperty( TK_DeleteNotesPages, false ) );
443 
444  setControlProperty( "CheckBox0Pg3", "State", Any( static_cast<sal_Int16>(bDeleteUnusedMasterPages) ) );
445  setControlProperty( "CheckBox1Pg3", "State", Any( static_cast<sal_Int16>(bDeleteNotesPages) ) );
446  setControlProperty( "CheckBox2Pg3", "State", Any( static_cast<sal_Int16>(bDeleteHiddenSlides) ) );
447 }
449 {
450  Sequence< OUString > aCustomShowList;
451  Reference< XModel > xModel( mxController->getModel() );
452  if ( xModel.is() )
453  {
454  Reference< XCustomPresentationSupplier > aXCPSup( xModel, UNO_QUERY_THROW );
455  Reference< XNameContainer > aXCont( aXCPSup->getCustomPresentations() );
456  if ( aXCont.is() )
457  aCustomShowList = aXCont->getElementNames();
458  }
459  std::vector< OUString > aControlList
460  {
461  InsertFixedText( *this, "FixedText0Pg3", getString( STR_CHOOSE_SLIDES ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, false, true, mnTabIndex++ ),
464  InsertCheckBox( *this, "CheckBox3Pg3", mxItemListener, getString( STR_CUSTOM_SHOW ), PAGE_POS_X + 6, PAGE_POS_Y + 42, PAGE_WIDTH - 12, mnTabIndex++ ),
465  InsertListBox( *this, "ListBox0Pg3", mxActionListener, true, aCustomShowList, PAGE_POS_X + 14, PAGE_POS_Y + 54, 150, mnTabIndex++ ),
467  };
468  maControlPages.push_back( aControlList );
469  DeactivatePage( 1 );
470 
471  setControlProperty( "CheckBox3Pg3", "State", Any( false ) );
472  setControlProperty( "CheckBox3Pg3", "Enabled", Any( aCustomShowList.hasElements() ) );
473  setControlProperty( "ListBox0Pg3", "Enabled", Any( false ) );
474 
476 }
477 
478 namespace
479 {
480 
481 bool lcl_getResolutionText(OUString& rResolutionText, std::u16string_view rImageResolution, sal_Int32 nTargetRes)
482 {
483  sal_Int32 nIdx{ 0 };
484  if (o3tl::toInt32(o3tl::getToken(rImageResolution, 0, ';', nIdx))!=nTargetRes)
485  return false;
486  rResolutionText = o3tl::getToken(rImageResolution, 0, ';', nIdx);
487  return true;
488 }
489 
490 }
491 
493 {
494  bool bJPEGCompression( GetConfigProperty( TK_JPEGCompression, false ) );
495  bool bRemoveCropArea( GetConfigProperty( TK_RemoveCropArea, false ) );
496  bool bEmbedLinkedGraphics( GetConfigProperty( TK_EmbedLinkedGraphics, true ) );
497  sal_Int32 nJPEGQuality( GetConfigProperty( TK_JPEGQuality, sal_Int32(90) ) );
498 
499  sal_Int32 nImageResolution( GetConfigProperty( TK_ImageResolution, sal_Int32(0) ) );
500 
501  OUString aResolutionText;
502  for (int nIR{ STR_IMAGE_RESOLUTION_0 }; nIR<=STR_IMAGE_RESOLUTION_3; ++nIR)
503  {
504  if (lcl_getResolutionText(aResolutionText, getString(static_cast<PPPOptimizerTokenEnum>(nIR)), nImageResolution))
505  break;
506  }
507  if ( aResolutionText.isEmpty() )
508  aResolutionText = OUString::number( nImageResolution );
509 
510  setControlProperty( "RadioButton0Pg1", "State", Any( static_cast<sal_Int16>( !bJPEGCompression ) ) );
511  setControlProperty( "RadioButton1Pg1", "State", Any( static_cast<sal_Int16>(bJPEGCompression) ) );
512  setControlProperty( "FixedText1Pg1", "Enabled", Any( bJPEGCompression ) );
513  setControlProperty( "FormattedField0Pg1", "Enabled", Any( bJPEGCompression ) );
514  setControlProperty( "FormattedField0Pg1", "EffectiveValue", Any( static_cast<double>(nJPEGQuality) ) );
515  setControlProperty( "CheckBox1Pg1", "State", Any( static_cast<sal_Int16>(bRemoveCropArea) ) );
516  setControlProperty( "ComboBox0Pg1", "Text", Any( aResolutionText ) );
517  setControlProperty( "CheckBox2Pg1", "State", Any( static_cast<sal_Int16>(bEmbedLinkedGraphics) ) );
518 }
520 {
521  Sequence< OUString > aResolutionItemList{
522  getString( STR_IMAGE_RESOLUTION_0 ).getToken( 1, ';' ),
523  getString( STR_IMAGE_RESOLUTION_1 ).getToken( 1, ';' ),
524  getString( STR_IMAGE_RESOLUTION_2 ).getToken( 1, ';' ),
525  getString( STR_IMAGE_RESOLUTION_3 ).getToken( 1, ';' )
526  };
527 
528  std::vector< OUString > aControlList
529  {
530  InsertFixedText( *this, "FixedText0Pg1", getString( STR_GRAPHIC_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, false, true, mnTabIndex++ ),
532  InsertRadioButton( *this, "RadioButton1Pg1", mxItemListener, getString( STR_JPEG_COMPRESSION ), PAGE_POS_X + 6, PAGE_POS_Y + 28, PAGE_WIDTH - 12, mnTabIndex++ ),
533  InsertFixedText( *this, "FixedText1Pg1", getString( STR_QUALITY ), PAGE_POS_X + 20, PAGE_POS_Y + 40, 72, 8, false, false, mnTabIndex++ ),
535  InsertFixedText( *this, "FixedText2Pg1", getString( STR_IMAGE_RESOLUTION ), PAGE_POS_X + 6, PAGE_POS_Y + 54, 94, 8, false, false, mnTabIndex++ ),
536  InsertComboBox( *this, "ComboBox0Pg1", mxTextListenerComboBox0Pg1, true, aResolutionItemList, PAGE_POS_X + 106, PAGE_POS_Y + 52, mnTabIndex++ ),
537  InsertCheckBox( *this, "CheckBox1Pg1", mxItemListener, getString( STR_REMOVE_CROP_AREA ), PAGE_POS_X + 6, PAGE_POS_Y + 68, PAGE_WIDTH - 12, mnTabIndex++ ),
539  };
540  maControlPages.push_back( aControlList );
541  DeactivatePage( 2 );
543 }
544 
545 
547 {
548  bool bConvertOLEObjects( GetConfigProperty( TK_OLEOptimization, false ) );
549  sal_Int16 nOLEOptimizationType( GetConfigProperty( TK_OLEOptimizationType, sal_Int16(0) ) );
550 
551  setControlProperty( "CheckBox0Pg2", "State", Any( static_cast<sal_Int16>(bConvertOLEObjects) ) );
552  setControlProperty( "RadioButton0Pg2", "Enabled", Any( bConvertOLEObjects ) );
553  setControlProperty( "RadioButton0Pg2", "State", Any( static_cast<sal_Int16>( nOLEOptimizationType == 0 ) ) );
554  setControlProperty( "RadioButton1Pg2", "Enabled", Any( bConvertOLEObjects ) );
555  setControlProperty( "RadioButton1Pg2", "State", Any( static_cast<sal_Int16>( nOLEOptimizationType == 1 ) ) );
556 }
558 {
559  int nOLECount = 0;
560  Reference< XModel > xModel( mxController->getModel() );
561  Reference< XDrawPagesSupplier > xDrawPagesSupplier( xModel, UNO_QUERY_THROW );
562  Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
563  for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
564  {
565  Reference< XShapes > xShapes( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
566  for ( sal_Int32 j = 0; j < xShapes->getCount(); j++ )
567  {
568  Reference< XShape > xShape( xShapes->getByIndex( j ), UNO_QUERY_THROW );
569  if ( xShape->getShapeType() == "com.sun.star.drawing.OLE2Shape" )
570  nOLECount++;
571  }
572  }
573 
574  std::vector< OUString > aControlList
575  {
576  InsertFixedText( *this, "FixedText0Pg2", getString( STR_OLE_OPTIMIZATION ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, false, true, mnTabIndex++ ),
577  InsertCheckBox( *this, "CheckBox0Pg2", mxItemListener, getString( STR_OLE_REPLACE ), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, mnTabIndex++ ),
578  InsertRadioButton( *this, "RadioButton0Pg2", mxItemListener, getString( STR_ALL_OLE_OBJECTS ), PAGE_POS_X + 14, PAGE_POS_Y + 28, PAGE_WIDTH - 22, mnTabIndex++ ),
580  InsertFixedText( *this, "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, true, false, mnTabIndex++ )
581  };
582  maControlPages.push_back( aControlList );
583  DeactivatePage( 3 );
585 }
586 
587 
588 static OUString ImpValueOfInMB( sal_Int64 rVal, sal_Unicode nSeparator )
589 {
590  double fVal( static_cast<double>( rVal ) );
591  fVal /= ( 1 << 20 );
592  fVal += 0.05;
593  OUStringBuffer aVal( OUString::number( fVal ) );
594  sal_Int32 nX( aVal.indexOf( '.' ) );
595  if ( nX >= 0 )
596  {
597  aVal.setLength( nX + 2 );
598  aVal[nX] = nSeparator;
599  }
600  aVal.append( " MB" );
601  return aVal.makeStringAndClear();
602 }
603 
605 {
606  bool bSaveAs( GetConfigProperty( TK_SaveAs, true ) );
607  if ( mbIsReadonly )
608  {
609  setControlProperty( "RadioButton0Pg4", "State", Any( sal_Int16(false) ) );
610  setControlProperty( "RadioButton1Pg4", "State", Any( sal_Int16(true) ) );
611  }
612  else
613  {
614  setControlProperty( "RadioButton0Pg4", "State", Any( static_cast<sal_Int16>( !bSaveAs ) ) );
615  setControlProperty( "RadioButton1Pg4", "State", Any( static_cast<sal_Int16>(bSaveAs) ) );
616  }
617  setControlProperty( "ComboBox0Pg4", "Enabled", Any( false ) );
618 
619  Sequence< OUString > aItemList;
620  const std::vector< OptimizerSettings >& rList( GetOptimizerSettings() );
621  if ( rList.size() > 1 ) // the first session in the list is the actual one -> skipping first one
622  {
623  aItemList.realloc( rList.size() - 1 );
624  auto pItemList = aItemList.getArray();
625  for ( std::vector<OptimizerSettings>::size_type w = 1; w < rList.size(); w++ )
626  pItemList[ w - 1 ] = rList[ w ].maName;
627  }
628  setControlProperty( "ComboBox0Pg4", "StringItemList", Any( aItemList ) );
629 
630  // now check if it is sensible to enable the combo box
631  bool bSaveSettingsEnabled = true;
632  if ( rList.size() > 1 ) // the first session in the list is the actual one -> skipping first one
633  {
634  for ( std::vector<OptimizerSettings>::size_type w = 1; w < rList.size(); w++ )
635  {
636  if ( rList[ w ] == rList[ 0 ] )
637  {
638  bSaveSettingsEnabled = false;
639  break;
640  }
641  }
642  }
643  sal_Int16 nInt16 = 0;
644  getControlProperty( "CheckBox1Pg4", "State" ) >>= nInt16;
645  setControlProperty( "CheckBox1Pg4", "Enabled", Any( bSaveSettingsEnabled ) );
646  setControlProperty( "ComboBox0Pg4", "Enabled", Any( bSaveSettingsEnabled && nInt16 ) );
647 
648  std::vector< OUString > aSummaryStrings;
649 
650  // taking care of deleted slides
651  sal_Int32 nDeletedSlides = 0;
652  if ( getControlProperty( "CheckBox3Pg3", "State" ) >>= nInt16 )
653  {
654  if ( nInt16 )
655  {
656  Sequence< short > aSelectedItems;
657  Sequence< OUString > aStringItemList;
658  Any aAny = getControlProperty( "ListBox0Pg3", "SelectedItems" );
659  if ( aAny >>= aSelectedItems )
660  {
661  if ( aSelectedItems.hasElements() )
662  {
663  sal_Int16 nSelectedItem = aSelectedItems[ 0 ];
664  aAny = getControlProperty( "ListBox0Pg3", "StringItemList" );
665  if ( aAny >>= aStringItemList )
666  {
667  if ( aStringItemList.getLength() > nSelectedItem )
668  SetConfigProperty( TK_CustomShowName, Any( aStringItemList[ nSelectedItem ] ) );
669  }
670  }
671  }
672  }
673  }
675  {
676  Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
677  Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
678  for( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
679  {
680  Reference< XDrawPage > xDrawPage( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
681  Reference< XPropertySet > xPropSet( xDrawPage, UNO_QUERY_THROW );
682 
683  bool bVisible = true;
684  if ( xPropSet->getPropertyValue( "Visible" ) >>= bVisible )
685  {
686  if (!bVisible )
687  nDeletedSlides++;
688  }
689  }
690  }
692  {
693  std::vector< PageCollector::MasterPageEntity > aMasterPageList;
694  PageCollector::CollectMasterPages( mxController->getModel(), aMasterPageList );
695  Reference< XMasterPagesSupplier > xMasterPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
696  Reference< XDrawPages > xMasterPages( xMasterPagesSupplier->getMasterPages(), UNO_SET_THROW );
697  nDeletedSlides += std::count_if(aMasterPageList.begin(), aMasterPageList.end(),
698  [](const PageCollector::MasterPageEntity& rEntity) { return !rEntity.bUsed; });
699  }
700  if ( nDeletedSlides > 1 )
701  {
702  OUString aStr( getString( STR_DELETE_SLIDES ) );
703  OUString aPlaceholder( "%SLIDES" );
704  sal_Int32 i = aStr.indexOf( aPlaceholder );
705  if ( i >= 0 )
706  aStr = aStr.replaceAt( i, aPlaceholder.getLength(), OUString::number( nDeletedSlides ) );
707  aSummaryStrings.push_back( aStr );
708  }
709 
710 // generating graphic compression info
711  sal_Int32 nGraphics = 0;
712  bool bJPEGCompression( GetConfigProperty( TK_JPEGCompression, false ) );
713  sal_Int32 nJPEGQuality( GetConfigProperty( TK_JPEGQuality, sal_Int32(90) ) );
714  sal_Int32 nImageResolution( GetConfigProperty( TK_ImageResolution, sal_Int32(0) ) );
715  GraphicSettings aGraphicSettings( bJPEGCompression, nJPEGQuality, GetConfigProperty( TK_RemoveCropArea, false ),
716  nImageResolution, GetConfigProperty( TK_EmbedLinkedGraphics, true ) );
717  GraphicCollector::CountGraphics( UnoDialog::mxContext, mxController->getModel(), aGraphicSettings, nGraphics );
718  if ( nGraphics > 1 )
719  {
720  OUString aStr( getString( STR_OPTIMIZE_IMAGES ) );
721  OUString aImagePlaceholder( "%IMAGES" );
722  OUString aQualityPlaceholder( "%QUALITY" );
723  OUString aResolutionPlaceholder( "%RESOLUTION" );
724  sal_Int32 i = aStr.indexOf( aImagePlaceholder );
725  if ( i >= 0 )
726  aStr = aStr.replaceAt( i, aImagePlaceholder.getLength(), OUString::number( nGraphics ) );
727 
728  sal_Int32 j = aStr.indexOf( aQualityPlaceholder );
729  if ( j >= 0 )
730  aStr = aStr.replaceAt( j, aQualityPlaceholder.getLength(), OUString::number( nJPEGQuality ) );
731 
732  sal_Int32 k = aStr.indexOf( aResolutionPlaceholder );
733  if ( k >= 0 )
734  aStr = aStr.replaceAt( k, aResolutionPlaceholder.getLength(), OUString::number( nImageResolution ) );
735 
736  aSummaryStrings.push_back( aStr );
737  }
738 
739  if ( GetConfigProperty( TK_OLEOptimization, false ) )
740  {
741  sal_Int32 nOLEReplacements = 0;
742  Reference< XDrawPagesSupplier > xDrawPagesSupplier( mxController->getModel(), UNO_QUERY_THROW );
743  Reference< XDrawPages > xDrawPages( xDrawPagesSupplier->getDrawPages(), UNO_SET_THROW );
744  for ( sal_Int32 i = 0; i < xDrawPages->getCount(); i++ )
745  {
746  Reference< XShapes > xShapes( xDrawPages->getByIndex( i ), UNO_QUERY_THROW );
747  for ( sal_Int32 j = 0; j < xShapes->getCount(); j++ )
748  {
749  Reference< XShape > xShape( xShapes->getByIndex( j ), UNO_QUERY_THROW );
750  if ( xShape->getShapeType() == "com.sun.star.drawing.OLE2Shape" )
751  nOLEReplacements++;
752  }
753  }
754  if ( nOLEReplacements > 1 )
755  {
756  OUString aStr( getString( STR_CREATE_REPLACEMENT ) );
757  OUString aPlaceholder( "%OLE" );
758  sal_Int32 i = aStr.indexOf( aPlaceholder );
759  if ( i >= 0 )
760  aStr = aStr.replaceAt( i, aPlaceholder.getLength(), OUString::number( nOLEReplacements ) );
761  aSummaryStrings.push_back( aStr );
762  }
763  }
764  while( aSummaryStrings.size() < 3 )
765  aSummaryStrings.emplace_back( );
766  setControlProperty( "FixedText4Pg4", "Label", Any( aSummaryStrings[ 0 ] ) );
767  setControlProperty( "FixedText5Pg4", "Label", Any( aSummaryStrings[ 1 ] ) );
768  setControlProperty( "FixedText6Pg4", "Label", Any( aSummaryStrings[ 2 ] ) );
769 
770  sal_Int64 nCurrentFileSize = 0;
771  sal_Int64 nEstimatedFileSize = 0;
772  Reference< XStorable > xStorable( mxController->getModel(), UNO_QUERY );
773  if ( xStorable.is() && xStorable->hasLocation() )
774  nCurrentFileSize = PPPOptimizer::GetFileSize( xStorable->getLocation() );
775 
776  if ( nCurrentFileSize )
777  {
778  double fE = static_cast< double >( nCurrentFileSize );
779  if ( nImageResolution )
780  {
781  double v = ( static_cast< double >( nImageResolution ) + 75.0 ) / 300.0;
782  if ( v < 1.0 )
783  fE *= v;
784  }
785  if ( bJPEGCompression )
786  {
787  double v = 0.75 - ( ( 100.0 - static_cast< double >( nJPEGQuality ) ) / 400.0 ) ;
788  fE *= v;
789  }
790  nEstimatedFileSize = static_cast< sal_Int64 >( fE );
791  }
792  sal_Unicode nSeparator = '.';
793  OUString aStr( getString( STR_FILESIZESEPARATOR ) );
794  if ( !aStr.isEmpty() )
795  nSeparator = aStr[ 0 ];
796  setControlProperty( "FixedText7Pg4", "Label", Any( ImpValueOfInMB( nCurrentFileSize, nSeparator ) ) );
797  setControlProperty( "FixedText8Pg4", "Label", Any( ImpValueOfInMB( nEstimatedFileSize, nSeparator ) ) );
798  SetConfigProperty( TK_EstimatedFileSize, Any( nEstimatedFileSize ) );
799 }
800 
802 {
803  { // creating progress bar:
804  OUString pNames[] = {
805  OUString("Height"),
806  OUString("Name"),
807  OUString("PositionX"),
808  OUString("PositionY"),
809  OUString("ProgressValue"),
810  OUString("ProgressValueMax"),
811  OUString("ProgressValueMin"),
812  OUString("Width") };
813 
814  Any pValues[] = {
815  Any( sal_Int32(12) ),
816  Any( OUString("STR_SAVE_AS") ),
817  Any( sal_Int32( PAGE_POS_X + 6 ) ),
818  Any( sal_Int32( DIALOG_HEIGHT - 75 ) ),
819  Any( sal_Int32(0) ),
820  Any( sal_Int32(100) ),
821  Any( sal_Int32(0) ),
822  Any( sal_Int32( PAGE_WIDTH - 12 ) ) };
823 
824  sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
825 
826  Sequence< OUString > aNames( pNames, nCount );
827  Sequence< Any > aValues( pValues, nCount );
828 
829  insertControlModel( "com.sun.star.awt.UnoControlProgressBarModel",
830  "Progress", aNames, aValues );
831  }
832  Reference< XTextListener > xTextListener;
833  Sequence< OUString > aItemList;
834  std::vector< OUString > aControlList
835  {
836  InsertFixedText( *this, "FixedText0Pg4", getString( STR_SUMMARY_TITLE ), PAGE_POS_X, PAGE_POS_Y, PAGE_WIDTH, 8, false, true, mnTabIndex++ ),
837  // InsertSeparator( *this, "Separator0Pg4", 0, PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, 1 ),
838 
839  InsertFixedText( *this, "FixedText4Pg4", OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 14, PAGE_WIDTH - 12, 8, false, false, mnTabIndex++ ),
840  InsertFixedText( *this, "FixedText5Pg4", OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 22, PAGE_WIDTH - 12, 8, false, false, mnTabIndex++ ),
841  InsertFixedText( *this, "FixedText6Pg4", OUString(), PAGE_POS_X + 6, PAGE_POS_Y + 30, PAGE_WIDTH - 12, 8, false, false, mnTabIndex++ ),
842 
843  InsertFixedText( *this, "FixedText2Pg4", getString( STR_CURRENT_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 50, 88, 8, false, false, mnTabIndex++ ),
844  InsertFixedText( *this, "FixedText7Pg4", OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 50, 30, 8, false, false, mnTabIndex++ )
845  };
846  setControlProperty( "FixedText7Pg4", "Align", Any( static_cast< short >( 2 ) ) );
847  aControlList.push_back( InsertFixedText( *this, "FixedText3Pg4", getString( STR_ESTIMATED_FILESIZE ), PAGE_POS_X + 6, PAGE_POS_Y + 58, 88, 8, false, false, mnTabIndex++ ) );
848  aControlList.push_back( InsertFixedText( *this, "FixedText8Pg4", OUString(), PAGE_POS_X + 100, PAGE_POS_Y + 58, 30, 8, false, false, mnTabIndex++ ) );
849  setControlProperty( "FixedText8Pg4", "Align", Any( static_cast< short >( 2 ) ) );
850 
851  aControlList.push_back( InsertRadioButton( *this, "RadioButton0Pg4", mxItemListener, getString( STR_APPLY_TO_CURRENT ), PAGE_POS_X + 6, PAGE_POS_Y + 78, PAGE_WIDTH - 12, mnTabIndex++ ) );
852  aControlList.push_back( InsertRadioButton( *this, "RadioButton1Pg4", mxItemListener, getString( STR_SAVE_AS ), PAGE_POS_X + 6, PAGE_POS_Y + 90, PAGE_WIDTH - 12, mnTabIndex++ ) );
853  aControlList.push_back( InsertFixedText( *this, "FixedText1Pg4", OUString(), PAGE_POS_X + 6, DIALOG_HEIGHT - 87, PAGE_WIDTH - 12, 8, true, false, mnTabIndex++ ) );
854  aControlList.emplace_back("Progress" );
855  aControlList.push_back( InsertSeparator( *this, "Separator1Pg4", 0, PAGE_POS_X + 6, DIALOG_HEIGHT - 58, PAGE_WIDTH - 12, 1 ) );
856  aControlList.push_back( InsertCheckBox( *this, "CheckBox1Pg4", mxItemListener, getString( STR_SAVE_SETTINGS ), PAGE_POS_X + 6, DIALOG_HEIGHT - 47, 100, mnTabIndex++ ) );
857  aControlList.push_back( InsertComboBox( *this, "ComboBox0Pg4", xTextListener, true, aItemList, PAGE_POS_X + 106, DIALOG_HEIGHT - 48, mnTabIndex++ ) );
858  maControlPages.push_back( aControlList );
859  DeactivatePage( 4 );
860 
861  // creating a default session name that hasn't been used yet
862  OUString aSettingsName;
863  OUString aDefault( getString( STR_MY_SETTINGS ) );
864  sal_Int32 nSession = 1;
865  std::vector<OptimizerSettings>::size_type i;
866  const std::vector< OptimizerSettings >& rList( GetOptimizerSettings() );
867  do
868  {
869  OUString aTemp = aDefault + OUString::number( nSession++ );
870  for ( i = 1; i < rList.size(); i++ )
871  {
872  if ( rList[ i ].maName == aTemp )
873  break;
874  }
875  if ( i == rList.size() )
876  aSettingsName = aTemp;
877  }
878  while( aSettingsName.isEmpty() );
879 
880  setControlProperty( "ComboBox0Pg4", "Text", Any( aSettingsName ) );
881  setControlProperty( "RadioButton0Pg4", "Enabled", Any( !mbIsReadonly ) );
882  setControlProperty( "RadioButton1Pg4", "Enabled", Any( !mbIsReadonly ) );
883 
885 }
886 
887 
888 void OptimizerDialog::EnablePage( sal_Int16 nStep )
889 {
890  for( const auto& rItem : maControlPages[ nStep ] )
891  setControlProperty( rItem, "Enabled", Any( true ) );
892 }
893 void OptimizerDialog::DisablePage( sal_Int16 nStep )
894 {
895  for( const auto& rItem : maControlPages[ nStep ] )
896  setControlProperty( rItem, "Enabled", Any( false ) );
897 }
898 void OptimizerDialog::ActivatePage( sal_Int16 nStep )
899 {
900  for( const auto& rItem : maControlPages[ nStep ] )
901  setVisible( rItem, true );
902 }
903 void OptimizerDialog::DeactivatePage( sal_Int16 nStep )
904 {
905  for( const auto& rItem : maControlPages[ nStep ] )
906  setVisible( rItem, false );
907 }
908 
909 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define PAGE_WIDTH
#define PAGE_POS_Y
#define BUTTON_POS_Y
void EnablePage(sal_Int16 nStep)
css::uno::Any getControlProperty(const OUString &rControlName, const OUString &rPropertyName)
Definition: unodialog.cxx:279
bool bVisible
css::uno::Reference< css::awt::XTextListener > mxTextListenerComboBox0Pg1
static OUString ImpValueOfInMB(sal_Int64 rVal, sal_Unicode nSeparator)
std::vector< std::vector< OUString > > maControlPages
static OUString InsertRadioButton(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, const Reference< XItemListener > &rItemListener, const OUString &rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex)
static OUString InsertCheckBox(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, const Reference< XItemListener > &xItemListener, const OUString &rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex)
css::uno::Reference< css::awt::XListBox > insertListBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:229
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
css::uno::Reference< css::awt::XActionListener > mxActionListenerListBox0Pg0
#define DIALOG_HEIGHT
void ActivatePage(sal_Int16 nStep)
static OUString InsertFixedText(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, const OUString &rLabel, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int32 nHeight, bool bMultiLine, bool bBold, sal_Int16 nTabIndex)
static OUString InsertSeparator(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, sal_Int32 nOrientation, sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight)
static sal_Int64 GetFileSize(const OUString &rURL)
static void CountGraphics(const css::uno::Reference< css::uno::XComponentContext > &rxMSF, const css::uno::Reference< css::frame::XModel > &rxModel, const GraphicSettings &rGraphicSettings, sal_Int32 &rGraphics)
css::uno::Reference< css::awt::XControl > insertFormattedField(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:178
sal_uInt16 sal_Unicode
void setControlProperty(const OUString &rControlName, const OUString &rPropertyName, const css::uno::Any &rPropertyValue)
Definition: unodialog.cxx:263
int nCount
#define BUTTON_HEIGHT
PPPOptimizerTokenEnum
static OUString InsertButton(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, Reference< XActionListener > const &xActionListener, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex, bool bEnabled, PPPOptimizerTokenEnum nResID, css::awt::PushButtonType nPushButtonType)
css::uno::Reference< css::awt::XItemListener > mxItemListener
#define SAL_N_ELEMENTS(arr)
css::uno::Reference< css::awt::XFixedText > insertFixedText(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:144
OUString getString(const PPPOptimizerTokenEnum) const
int i
void SetConfigProperty(const PPPOptimizerTokenEnum, const css::uno::Any &aValue)
void DeactivatePage(sal_Int16 nStep)
#define PAGE_POS_X
sal_Int32 w
css::uno::Reference< css::awt::XComboBox > insertComboBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:195
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
css::uno::Reference< css::awt::XRadioButton > insertRadioButton(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:212
static OUString InsertListBox(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, const Reference< XActionListener > &rActionListener, const bool bEnabled, const Sequence< OUString > &rItemList, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex)
css::uno::Reference< css::uno::XComponentContext > mxContext
Definition: unodialog.hxx:98
css::uno::Reference< css::awt::XCheckBox > insertCheckBox(const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:161
static OUString InsertComboBox(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, const Reference< XTextListener > &rTextListener, const bool bEnabled, const Sequence< OUString > &rItemList, sal_Int32 nXPos, sal_Int32 nYPos, sal_Int16 nTabIndex)
css::uno::Reference< css::awt::XTextListener > mxTextListenerFormattedField0Pg1
float v
void DisablePage(sal_Int16 nStep)
static void CollectMasterPages(const css::uno::Reference< css::frame::XModel > &, std::vector< MasterPageEntity > &)
static OUString InsertFormattedField(OptimizerDialog &rOptimizerDialog, const OUString &rControlName, const Reference< XTextListener > &xTextListener, const Reference< XSpinListener > &xSpinListener, sal_Int32 nXPos, sal_Int32 nYPos, double fEffectiveMin, double fEffectiveMax, sal_Int16 nTabIndex)
#define OD_DIALOG_WIDTH
const PropertyValue * pValues
css::uno::Reference< css::frame::XController > mxController
Definition: unodialog.hxx:99
css::uno::Reference< css::uno::XInterface > insertControlModel(const OUString &rServiceName, const OUString &rName, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:86
void setVisible(const OUString &rName, bool bVisible)
Definition: unodialog.cxx:104
OUString maName
std::vector< OptimizerSettings > & GetOptimizerSettings()
css::uno::Reference< css::awt::XSpinListener > mxSpinListenerFormattedField0Pg1
#define BUTTON_WIDTH
css::uno::Any GetConfigProperty(const PPPOptimizerTokenEnum) const
css::uno::Reference< css::awt::XActionListener > mxActionListener
Reference< XModel > xModel
static void SetBold(OptimizerDialog &rOptimizerDialog, const OUString &rControl)
aStr
css::uno::Reference< css::awt::XButton > insertButton(const OUString &rName, const css::uno::Reference< css::awt::XActionListener > &xActionListener, const css::uno::Sequence< OUString > &rPropertyNames, const css::uno::Sequence< css::uno::Any > &rPropertyValues)
Definition: unodialog.cxx:118