compilerplugins/clang/unusedenumconstants.writeonly.results               |    
2 
 officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu   |   
22 
 officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs |   
32 -
 sd/UIConfig_simpress.mk                                                   |    
1 
 sd/uiconfig/simpress/ui/pminfodialog.ui                                   |   
46 +
 sdext/source/minimizer/impoptimizer.cxx                                   |    
9 
 sdext/source/minimizer/impoptimizer.hxx                                   |    
4 
 sdext/source/minimizer/informationdialog.cxx                              |  
272 +---------
 sdext/source/minimizer/informationdialog.hxx                              |   
41 -
 sdext/source/minimizer/optimizerdialog.cxx                                |    
3 
 sdext/source/minimizer/pppoptimizertoken.cxx                              |   
13 
 sdext/source/minimizer/pppoptimizertoken.hxx                              |   
13 
 12 files changed, 137 insertions(+), 321 deletions(-)

New commits:
commit 54f74923644c427f5d5c1aaf307be866d1991816
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Dec 6 16:34:23 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Dec 6 19:30:22 2022 +0000

    weld InformationDialog info dialog
    
    Change-Id: I6a3631fe06a1b46164f01d706ecefd7252509382
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143740
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/compilerplugins/clang/unusedenumconstants.writeonly.results 
b/compilerplugins/clang/unusedenumconstants.writeonly.results
index bf474efc7ad8..e78ed74414cd 100644
--- a/compilerplugins/clang/unusedenumconstants.writeonly.results
+++ b/compilerplugins/clang/unusedenumconstants.writeonly.results
@@ -3952,8 +3952,6 @@ sdext/source/minimizer/pppoptimizertoken.hxx:110
     enum PPPOptimizerTokenEnum STR_SLIDES
 sdext/source/minimizer/pppoptimizertoken.hxx:116
     enum PPPOptimizerTokenEnum STR_SUMMARY
-sdext/source/minimizer/pppoptimizertoken.hxx:119
-    enum PPPOptimizerTokenEnum STR_AUTOMATICALLY_OPEN
 sdext/source/minimizer/pppoptimizertoken.hxx:122
     enum PPPOptimizerTokenEnum STR_DELETE_SLIDES
 sdext/source/minimizer/pppoptimizertoken.hxx:123
diff --git 
a/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu 
b/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu
index f1ac8d8f1891..f9a9ea5e3546 100644
--- a/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/PresentationMinimizer.xcu
@@ -47,9 +47,6 @@ The current presentation contains no OLE objects.</value>
         <prop oor:name="STR_SUMMARY">
             <value xml:lang="en-US">Summary</value>
         </prop>
-        <prop oor:name="STR_AUTOMATICALLY_OPEN">
-            <value xml:lang="en-US">~Open newly created presentation</value>
-        </prop>
         <prop oor:name="STR_DELETE_SLIDES">
             <value xml:lang="en-US">Delete %SLIDES slides.</value>
         </prop>
@@ -65,17 +62,20 @@ The current presentation contains no OLE objects.</value>
         <prop oor:name="STR_OK">
             <value xml:lang="en-US">OK</value>
         </prop>
-        <prop oor:name="STR_INFO_1">
-            <value xml:lang="en-US">The Presentation Minimizer has 
successfully updated the presentation '%TITLE'. The file size has changed from 
%OLDFILESIZE MB to %NEWFILESIZE MB.</value>
+        <prop oor:name="STR_INFO_PRIMARY">
+            <value xml:lang="en-US">Successfully updated the presentation 
'%TITLE'.</value>
+        </prop>
+        <prop oor:name="STR_INFO_SECONDARY_1">
+            <value xml:lang="en-US">The file size has changed from 
%OLDFILESIZE MB to %NEWFILESIZE MB.</value>
         </prop>
-        <prop oor:name="STR_INFO_2">
-            <value xml:lang="en-US">The Presentation Minimizer has 
successfully updated the presentation '%TITLE'. The file size has changed from 
%OLDFILESIZE MB to approximated %NEWFILESIZE MB.</value>
+        <prop oor:name="STR_INFO_SECONDARY_2">
+            <value xml:lang="en-US">The file size has changed from 
%OLDFILESIZE MB to approximated %NEWFILESIZE MB.</value>
         </prop>
-        <prop oor:name="STR_INFO_3">
-            <value xml:lang="en-US">The Presentation Minimizer has 
successfully updated the presentation '%TITLE'. The file size has changed to 
%NEWFILESIZE MB.</value>
+        <prop oor:name="STR_INFO_SECONDARY_3">
+            <value xml:lang="en-US">The file size has changed to %NEWFILESIZE 
MB.</value>
         </prop>
-        <prop oor:name="STR_INFO_4">
-            <value xml:lang="en-US">The Presentation Minimizer has 
successfully updated the presentation '%TITLE'. The file size has changed to 
approximated %NEWFILESIZE MB.</value>
+        <prop oor:name="STR_INFO_SECONDARY_4">
+            <value xml:lang="en-US">The file size has changed to approximated 
%NEWFILESIZE MB.</value>
         </prop>
         <prop oor:name="STR_DUPLICATING_PRESENTATION">
             <value xml:lang="en-US">Duplicating presentation...</value>
diff --git 
a/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs 
b/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs
index d2148807ca01..8a6eadb7c3a8 100644
--- a/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/PresentationMinimizer.xcs
@@ -161,10 +161,6 @@ The current presentation contains no OLE objects.</value>
                <info><desc>String STR_SUMMARY.</desc></info>
                                <value>Summary</value>
                        </prop>
-                       <prop oor:name="STR_AUTOMATICALLY_OPEN" 
oor:type="xs:string" oor:localized="true">
-               <info><desc>String STR_AUTOMATICALLY_OPEN.</desc></info>
-                               <value>~Open newly created presentation</value>
-                       </prop>
                        <prop oor:name="STR_DELETE_SLIDES" oor:type="xs:string" 
oor:localized="true">
                <info><desc>String STR_DELETE_SLIDES.</desc></info>
                                <value>Delete %SLIDES slides</value>
@@ -187,21 +183,25 @@ The current presentation contains no OLE objects.</value>
                <info><desc>String STR_OK.</desc></info>
                 <value>OK</value>
            </prop>
-            <prop oor:name="STR_INFO_1" oor:type="xs:string" 
oor:localized="true">
-               <info><desc>String STR_INFO_1.</desc></info>
-                <value>The Presentation Minimizer has successfully updated the 
presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to 
%NEWFILESIZE MB.</value>
+            <prop oor:name="STR_INFO_PRIMARY" oor:type="xs:string" 
oor:localized="true">
+               <info><desc>String STR_INFO_SECONDARY_1.</desc></info>
+                <value>The Presentation Minimizer has successfully updated the 
presentation '%TITLE'.</value>
+           </prop>
+          <prop oor:name="STR_INFO_SECONDARY_1" oor:type="xs:string" 
oor:localized="true">
+               <info><desc>String STR_INFO_SECONDARY_1.</desc></info>
+                <value>The file size has changed from %OLDFILESIZE MB to 
%NEWFILESIZE MB.</value>
            </prop>
-            <prop oor:name="STR_INFO_2" oor:type="xs:string" 
oor:localized="true">
-               <info><desc>String STR_INFO_2.</desc></info>
-                <value>The Presentation Minimizer has successfully updated the 
presentation '%TITLE'. The file size has changed from %OLDFILESIZE MB to 
approximated %NEWFILESIZE MB.</value>
+            <prop oor:name="STR_INFO_SECONDARY_2" oor:type="xs:string" 
oor:localized="true">
+               <info><desc>String STR_INFO_SECONDARY_2.</desc></info>
+                <value>The file size has changed from %OLDFILESIZE MB to 
approximated %NEWFILESIZE MB.</value>
            </prop>
-            <prop oor:name="STR_INFO_3" oor:type="xs:string" 
oor:localized="true">
-               <info><desc>String STR_INFO_3.</desc></info>
-                <value>The Presentation Minimizer has successfully updated the 
presentation '%TITLE'. The file size has changed to %NEWFILESIZE MB.</value>
+            <prop oor:name="STR_INFO_SECONDARY_3" oor:type="xs:string" 
oor:localized="true">
+               <info><desc>String STR_INFO_SECONDARY_3.</desc></info>
+                <value>The file size has changed to %NEWFILESIZE MB.</value>
            </prop>
-            <prop oor:name="STR_INFO_4" oor:type="xs:string" 
oor:localized="true">
-               <info><desc>String STR_INFO_4.</desc></info>
-                <value>The Presentation Minimizer has successfully updated the 
presentation '%TITLE'. The file size has changed to approximated %NEWFILESIZE 
MB.</value>
+            <prop oor:name="STR_INFO_SECONDARY_4" oor:type="xs:string" 
oor:localized="true">
+               <info><desc>String STR_INFO_SECONDARY_4.</desc></info>
+                <value>The file size has changed to approximated %NEWFILESIZE 
MB.</value>
            </prop>
             <prop oor:name="STR_DUPLICATING_PRESENTATION" oor:type="xs:string" 
oor:localized="true">
                <info><desc>String STR_DUPLICATING_PRESENTATION.</desc></info>
diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk
index d71e7ff71f67..ab6b2875e7bc 100644
--- a/sd/UIConfig_simpress.mk
+++ b/sd/UIConfig_simpress.mk
@@ -151,6 +151,7 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/simpress,\
        sd/uiconfig/simpress/ui/pagesfieldbox \
        sd/uiconfig/simpress/ui/photoalbum \
        sd/uiconfig/simpress/ui/pmimagespage \
+       sd/uiconfig/simpress/ui/pminfodialog \
        sd/uiconfig/simpress/ui/pmintropage \
        sd/uiconfig/simpress/ui/pmobjectspage \
        sd/uiconfig/simpress/ui/pmslidespage \
diff --git a/sd/uiconfig/simpress/ui/pminfodialog.ui 
b/sd/uiconfig/simpress/ui/pminfodialog.ui
new file mode 100644
index 000000000000..29a4a1524a9a
--- /dev/null
+++ b/sd/uiconfig/simpress/ui/pminfodialog.ui
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.40.0 -->
+<interface domain="sd">
+  <requires lib="gtk+" version="3.20"/>
+  <object class="GtkMessageDialog" id="PMInfoDialog">
+    <property name="can-focus">False</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="type-hint">dialog</property>
+    <property name="buttons">ok</property>
+    <child internal-child="vbox">
+      <object class="GtkBox">
+        <property name="can-focus">False</property>
+        <property name="orientation">vertical</property>
+        <property name="spacing">2</property>
+        <child internal-child="action_area">
+          <object class="GtkButtonBox">
+            <property name="can-focus">False</property>
+            <property name="homogeneous">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">False</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkCheckButton" id="ask">
+            <property name="label" translatable="yes" 
context="pminfodialog|ask">_Open newly created presentation</property>
+            <property name="visible">True</property>
+            <property name="can-focus">True</property>
+            <property name="receives-default">False</property>
+            <property name="halign">start</property>
+            <property name="use-underline">True</property>
+            <property name="draw-indicator">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="fill">True</property>
+            <property name="position">2</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/sdext/source/minimizer/impoptimizer.cxx 
b/sdext/source/minimizer/impoptimizer.cxx
index 721d7ef51bfe..d8079a588775 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -570,6 +570,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue 
>& rArguments )
         {
             case TK_StatusDispatcher : rArgument.Value >>= mxStatusDispatcher; 
break;
             case TK_DocumentFrame: rArgument.Value >>= mxDocumentFrame; break;
+            case TK_DialogParentWindow: rArgument.Value >>= 
mxDialogParentWindow; break;
             case TK_Settings :
             {
                 css::uno::Sequence< css::beans::PropertyValue > aSettings;
@@ -673,7 +674,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue 
>& rArguments )
 
     if ( mxDocumentFrame.is() )
     {
-        InformationDialog aInformationDialog( mxContext, mxDocumentFrame, 
maSaveAsURL, mbOpenNewDocument, nSourceSize, nDestSize, nEstimatedFileSize );
+        InformationDialog aInformationDialog( mxContext, mxDialogParentWindow, 
maSaveAsURL, mbOpenNewDocument, nSourceSize, nDestSize, nEstimatedFileSize );
         aInformationDialog.execute();
         SetStatusValue( TK_OpenNewDocument, Any( mbOpenNewDocument ) );
         DispatchStatus();
diff --git a/sdext/source/minimizer/impoptimizer.hxx 
b/sdext/source/minimizer/impoptimizer.hxx
index a7436f7cec92..98d22e71d137 100644
--- a/sdext/source/minimizer/impoptimizer.hxx
+++ b/sdext/source/minimizer/impoptimizer.hxx
@@ -35,6 +35,8 @@ private:
     css::uno::Reference< css::uno::XComponentContext >    mxContext;
     css::uno::Reference< css::frame::XModel >             mxModel;
     css::uno::Reference< css::frame::XDispatch >          mxStatusDispatcher;
+    css::uno::Reference<css::frame::XFrame>               mxDocumentFrame;
+    css::uno::Reference<css::awt::XWindow>                mxDialogParentWindow;
 
     bool        mbJPEGCompression;
     sal_Int32   mnJPEGQuality;
@@ -51,8 +53,6 @@ private:
     OUString    maFilterName;
     bool        mbOpenNewDocument;
 
-    css::uno::Reference< css::frame::XFrame > mxDocumentFrame;
-
     void Optimize();
 
 public:
diff --git a/sdext/source/minimizer/informationdialog.cxx 
b/sdext/source/minimizer/informationdialog.cxx
index 0797e78560cf..0a6620dc02f7 100644
--- a/sdext/source/minimizer/informationdialog.cxx
+++ b/sdext/source/minimizer/informationdialog.cxx
@@ -26,12 +26,7 @@
 #include <com/sun/star/util/XURLTransformer.hpp>
 #include <rtl/ustrbuf.hxx>
 #include <sal/macros.h>
-
-#define DIALOG_WIDTH    240
-#define DIALOG_HEIGHT   80
-#define PAGE_POS_X      35
-#define PAGE_WIDTH      ( DIALOG_WIDTH - PAGE_POS_X ) - 6
-
+#include <vcl/svapp.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::ui;
@@ -43,148 +38,6 @@ using namespace ::com::sun::star::frame;
 using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::container;
 
-
-OUString InsertFixedText( UnoDialog& rInformationDialog, const OUString& 
rControlName, const OUString& rLabel,
-                                sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 
nWidth, sal_Int32 nHeight, bool bMultiLine, sal_Int16 nTabIndex )
-{
-    OUString pNames[] = {
-        OUString("Height"),
-        OUString("Label"),
-        OUString("MultiLine"),
-        OUString("PositionX"),
-        OUString("PositionY"),
-        OUString("Step"),
-        OUString("TabIndex"),
-        OUString("Width") };
-
-    Any pValues[] = {
-        Any( nHeight ),
-        Any( rLabel ),
-        Any( bMultiLine ),
-        Any( nXPos ),
-        Any( nYPos ),
-        Any( sal_Int16(0) ),
-        Any( nTabIndex ),
-        Any( nWidth ) };
-
-    sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
-
-    Sequence< OUString >   aNames( pNames, nCount );
-    Sequence< Any >             aValues( pValues, nCount );
-
-    rInformationDialog.insertFixedText( rControlName, aNames, aValues );
-    return rControlName;
-}
-
-OUString InsertImage(
-    UnoDialog& rInformationDialog,
-    const OUString& rControlName,
-    const OUString& rURL,
-    sal_Int32 nPosX,
-    sal_Int32 nPosY,
-    sal_Int32 nWidth,
-    sal_Int32 nHeight,
-    bool bScale )
-{
-    OUString pNames[] = {
-        OUString("Border"),
-        OUString("Height"),
-        OUString("ImageURL"),
-        OUString("PositionX"),
-        OUString("PositionY"),
-        OUString("ScaleImage"),
-        OUString("Width") };
-
-    Any pValues[] = {
-        Any( sal_Int16( 0 ) ),
-        Any( nHeight ),
-        Any( rURL ),
-        Any( nPosX ),
-        Any( nPosY ),
-        Any( bScale ),
-        Any( nWidth ) };
-    sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
-
-    Sequence< OUString >   aNames( pNames, nCount );
-    Sequence< Any >             aValues( pValues, nCount );
-
-    rInformationDialog.insertImage( rControlName, aNames, aValues );
-    return rControlName;
-}
-
-OUString InsertCheckBox( UnoDialog& rInformationDialog, const OUString& 
rControlName,
-    const Reference< XItemListener >& rItemListener, const OUString& rLabel,
-    sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex )
-{
-    sal_Int32 nHeight = 8;
-    OUString pNames[] = {
-        OUString("Enabled"),
-        OUString("Height"),
-        OUString("Label"),
-        OUString("PositionX"),
-        OUString("PositionY"),
-        OUString("Step"),
-        OUString("TabIndex"),
-        OUString("Width") };
-
-    Any pValues[] = {
-        Any( true ),
-        Any( nHeight ),
-        Any( rLabel ),
-        Any( nXPos ),
-        Any( nYPos ),
-        Any( sal_Int16(0) ),
-        Any( nTabIndex ),
-        Any( nWidth ) };
-
-    sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
-
-    Sequence< OUString >   aNames( pNames, nCount );
-    Sequence< Any >             aValues( pValues, nCount );
-
-    Reference< XCheckBox > xCheckBox( rInformationDialog.insertCheckBox( 
rControlName, aNames, aValues ) );
-    if ( rItemListener.is() )
-        xCheckBox->addItemListener( rItemListener );
-    return rControlName;
-}
-
-OUString InsertButton( UnoDialog& rInformationDialog, const OUString& 
rControlName, Reference< XActionListener > const & xActionListener,
-    sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex, 
const OUString& rText )
-{
-    sal_Int32 nHeight = 14;
-    OUString pNames[] = {
-        OUString("Enabled"),
-        OUString("Height"),
-        OUString("Label"),
-        OUString("PositionX"),
-        OUString("PositionY"),
-        OUString("PushButtonType"),
-        OUString("Step"),
-        OUString("TabIndex"),
-        OUString("Width") };
-
-    Any pValues[] = {
-        Any( true ),
-        Any( nHeight ),
-        Any( rText ),
-        Any( nXPos ),
-        Any( nYPos ),
-        Any( static_cast< sal_Int16 >( PushButtonType_OK ) ),
-        Any( sal_Int16(0) ),
-        Any( nTabIndex ),
-        Any( nWidth ) };
-
-
-    sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
-
-    Sequence< OUString >   aNames( pNames, nCount );
-    Sequence< Any >             aValues( pValues, nCount );
-
-    rInformationDialog.insertButton( rControlName, xActionListener, aNames, 
aValues );
-    return rControlName;
-}
-
-
 static OUString ImpValueOfInMB( sal_Int64 rVal )
 {
     double fVal( static_cast<double>( rVal ) );
@@ -199,62 +52,34 @@ static OUString ImpValueOfInMB( sal_Int64 rVal )
 
 void InformationDialog::InitDialog()
 {
-    sal_Int32 nDialogHeight = DIALOG_HEIGHT;
-    if ( maSaveAsURL.isEmpty() )
-        nDialogHeight -= 22;
-
-   // setting the dialog properties
-    OUString pNames[] = {
-        OUString("Closeable"),
-        OUString("Height"),
-        OUString("Moveable"),
-        OUString("PositionX"),
-        OUString("PositionY"),
-        OUString("Title"),
-        OUString("Width") };
-
-    Any pValues[] = {
-        Any( true ),
-        Any( nDialogHeight ),
-        Any( true ),
-        Any( sal_Int32( 245 ) ),
-        Any( sal_Int32( 115 ) ),
-        Any( getString( STR_SUN_OPTIMIZATION_WIZARD2 ) ),
-        Any( sal_Int32( DIALOG_WIDTH ) ) };
-
-    sal_Int32 nCount = SAL_N_ELEMENTS( pNames );
-
-    Sequence< OUString >   aNames( pNames, nCount );
-    Sequence< Any >             aValues( pValues, nCount );
-
-    setPropertyValues(aNames, aValues);
+    set_title(getString(STR_SUN_OPTIMIZATION_WIZARD2));
 
     sal_Int64 nSource = mnSourceSize;
     sal_Int64 nDest   = mnDestSize;
 
-    PPPOptimizerTokenEnum eInfoString( STR_INFO_1 );
+    PPPOptimizerTokenEnum eInfoString( STR_INFO_SECONDARY_1 );
     if ( mnSourceSize )
     {
         if ( mnDestSize )
-            eInfoString = STR_INFO_1;
+            eInfoString = STR_INFO_SECONDARY_1;
         else
         {
-            eInfoString = STR_INFO_2;
+            eInfoString = STR_INFO_SECONDARY_2;
             nDest = mnApproxSize;
         }
     }
     else if ( mnDestSize )
-        eInfoString = STR_INFO_3;
+        eInfoString = STR_INFO_SECONDARY_3;
     else
     {
-        eInfoString = STR_INFO_4;
+        eInfoString = STR_INFO_SECONDARY_4;
         nDest = mnApproxSize;
     }
 
     OUString aTitle;
     if ( !maSaveAsURL.isEmpty() )
     {
-        Reference< XURLTransformer > xURLTransformer( 
URLTransformer::create(UnoDialog::mxContext) );
+        Reference< XURLTransformer > xURLTransformer( 
URLTransformer::create(mxContext) );
         util::URL aURL, aPresentationURL;
         aURL.Complete = maSaveAsURL;
         xURLTransformer->parseSmart( aURL, OUString() );
@@ -267,84 +92,55 @@ void InformationDialog::InitDialog()
             aTitle = aTitle.replaceAt( 0, sFileProtocol.getLength(), u"" );
     }
 
-    OUString aInfoString( getString( eInfoString ) );
+    OUString sPrimary( getString( STR_INFO_PRIMARY ) );
+    OUString sSecondary( getString( eInfoString ) );
     static const OUStringLiteral aOldSizePlaceholder( u"%OLDFILESIZE"  );
     static const OUStringLiteral aNewSizePlaceholder( u"%NEWFILESIZE"  );
     const OUString aTitlePlaceholder( !aTitle.isEmpty() ? OUString("%TITLE"  )
                                                          : 
OUString("'%TITLE'") );
 
-    sal_Int32 i = aInfoString.indexOf( aOldSizePlaceholder );
+    sal_Int32 i = sSecondary.indexOf( aOldSizePlaceholder );
     if ( i >= 0 )
-        aInfoString = aInfoString.replaceAt( i, 
aOldSizePlaceholder.getLength(), ImpValueOfInMB( nSource ) );
+        sSecondary = sSecondary.replaceAt( i, aOldSizePlaceholder.getLength(), 
ImpValueOfInMB( nSource ) );
 
-    sal_Int32 j = aInfoString.indexOf( aNewSizePlaceholder );
+    sal_Int32 j = sSecondary.indexOf( aNewSizePlaceholder );
     if ( j >= 0 )
-        aInfoString = aInfoString.replaceAt( j, 
aNewSizePlaceholder.getLength(), ImpValueOfInMB( nDest ) );
+        sSecondary = sSecondary.replaceAt( j, aNewSizePlaceholder.getLength(), 
ImpValueOfInMB( nDest ) );
 
-    sal_Int32 k = aInfoString.indexOf( aTitlePlaceholder );
+    sal_Int32 k = sPrimary.indexOf( aTitlePlaceholder );
     if ( k >= 0 )
-        aInfoString = aInfoString.replaceAt( k, aTitlePlaceholder.getLength(), 
aTitle );
-
-    css::uno::Reference< css::awt::XItemListener > xItemListener;
-    InsertImage( *this,
-                 "aboutimage",
-                 "private:standardimage/query",
-                 5, 5, 25, 25, false );
-    InsertFixedText( *this, "fixedtext", aInfoString, PAGE_POS_X, 6, 
PAGE_WIDTH, 24, true, 0 );
-    if ( !maSaveAsURL.isEmpty() )
-        InsertCheckBox(  *this, "OpenNewDocument", xItemListener, getString( 
STR_AUTOMATICALLY_OPEN ), PAGE_POS_X, 42, PAGE_WIDTH, 1 );
-    InsertButton( *this, "button", mxActionListener, DIALOG_WIDTH / 2 - 25, 
nDialogHeight - 20, 50, 2, getString( STR_OK ) );
+        sPrimary = sPrimary.replaceAt( k, aTitlePlaceholder.getLength(), 
aTitle );
 
-    bool bOpenNewDocument = mrbOpenNewDocument;
-    setControlProperty( "OpenNewDocument", "State", Any( 
static_cast<sal_Int16>(bOpenNewDocument) ) );
+    set_primary_text(sPrimary);
+    set_secondary_text(sSecondary);
+    mxCheckBox->set_visible(!maSaveAsURL.isEmpty());
+    mxCheckBox->set_active(mrbOpenNewDocument);
 }
 
-
-InformationDialog::InformationDialog( const Reference< XComponentContext > 
&rxContext, Reference< XFrame > const & rxFrame, const OUString& rSaveAsURL, 
bool& rbOpenNewDocument, sal_Int64 rSourceSize, sal_Int64 rDestSize, sal_Int64 
rApproxSize ) :
-    UnoDialog( rxContext, rxFrame ),
-    ConfigurationAccess( rxContext ),
-    mxActionListener( new OKActionListener( *this ) ),
-    mnSourceSize( rSourceSize ),
-    mnDestSize( rDestSize ),
-    mnApproxSize( rApproxSize ),
-    mrbOpenNewDocument( rbOpenNewDocument ),
-    maSaveAsURL( rSaveAsURL )
+InformationDialog::InformationDialog(const Reference< XComponentContext > 
&rxContext, const Reference<XWindow>& rxDialogParent,
+                                     const OUString& rSaveAsURL, bool& 
rbOpenNewDocument,
+                                     sal_Int64 rSourceSize, sal_Int64 
rDestSize, sal_Int64 rApproxSize)
+    : MessageDialogController(Application::GetFrameWeld(rxDialogParent), 
"modules/simpress/ui/pminfodialog.ui", "PMInfoDialog", "ask")
+    , ConfigurationAccess(rxContext)
+    , mxCheckBox(m_xBuilder->weld_check_button("ask"))
+    , mnSourceSize(rSourceSize)
+    , mnDestSize(rDestSize)
+    , mnApproxSize(rApproxSize)
+    , mrbOpenNewDocument(rbOpenNewDocument)
+    , maSaveAsURL(rSaveAsURL)
 {
     InitDialog();
 }
 
-
 InformationDialog::~InformationDialog()
 {
 }
 
-
 void InformationDialog::execute()
 {
-    UnoDialog::execute();
-
-    if ( !maSaveAsURL.isEmpty() )
-    {
-        sal_Int16 nInt16 = 0;
-        Any aAny( getControlProperty( "OpenNewDocument", "State" ) );
-        if ( aAny >>= nInt16 )
-        {
-            bool bOpenNewDocument = static_cast< bool >( nInt16 );
-            mrbOpenNewDocument = bOpenNewDocument;
-        }
-    }
-}
-
-
-void OKActionListener::actionPerformed( const ActionEvent& rEvent )
-{
-    if ( rEvent.ActionCommand == "button" )
-    {
-        mrDialog.endExecute( true );
-    }
-}
-void OKActionListener::disposing( const css::lang::EventObject& /* Source */ )
-{
+    run();
+    if (!maSaveAsURL.isEmpty())
+        mrbOpenNewDocument = mxCheckBox->get_active();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/minimizer/informationdialog.hxx 
b/sdext/source/minimizer/informationdialog.hxx
index 761a40e01e7e..6468ed575147 100644
--- a/sdext/source/minimizer/informationdialog.hxx
+++ b/sdext/source/minimizer/informationdialog.hxx
@@ -17,35 +17,20 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_SDEXT_SOURCE_MINIMIZER_INFORMATIONDIALOG_HXX
-#define INCLUDED_SDEXT_SOURCE_MINIMIZER_INFORMATIONDIALOG_HXX
+#pragma once
 
 #include "unodialog.hxx"
 #include "configurationaccess.hxx"
-#include <com/sun/star/awt/XItemListener.hpp>
+#include <vcl/weld.hxx>
 #include <com/sun/star/uno/XComponentContext.hpp>
 #include <cppuhelper/implbase.hxx>
 
-OUString InsertFixedText( UnoDialog& rInformationDialog, const OUString& 
rControlName, const OUString& rLabel,
-                                sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 
nWidth, sal_Int32 nHeight, bool bMultiLine, sal_Int16 nTabIndex );
-
-OUString InsertImage( UnoDialog& rInformationDialog, const OUString& 
rControlName, const OUString& rURL,
-    sal_Int32 nPosX, sal_Int32 nPosY, sal_Int32 nWidth, sal_Int32 nHeight, 
bool bScale );
-
-OUString InsertCheckBox( UnoDialog& rInformationDialog, const OUString& 
rControlName,
-    const css::uno::Reference< css::awt::XItemListener >& rItemListener, const 
OUString& rLabel,
-    sal_Int32 nXPos, sal_Int32 nYPos, sal_Int32 nWidth, sal_Int16 nTabIndex );
-
-OUString InsertButton( UnoDialog& rInformationDialog, const OUString& 
rControlName,
-    css::uno::Reference< css::awt::XActionListener > const & xActionListener, 
sal_Int32 nXPos, sal_Int32 nYPos,
-    sal_Int32 nWidth, sal_Int16 nTabIndex, const OUString& rText );
-
-class InformationDialog : public UnoDialog, public ConfigurationAccess
+class InformationDialog : public weld::MessageDialogController, public 
ConfigurationAccess
 {
 public:
 
     InformationDialog( const css::uno::Reference< css::uno::XComponentContext 
>& rxContext,
-                       css::uno::Reference< css::frame::XFrame > const & 
rxFrame, const OUString& rSaveAsURL,
+                       const css::uno::Reference<css::awt::XWindow>& 
rxDialogParent, const OUString& rSaveAsURL,
                        bool& bOpenNewDocument, sal_Int64 nSourceSize, 
sal_Int64 nDestSize, sal_Int64 nApproxDest );
     ~InformationDialog();
 
@@ -53,10 +38,10 @@ public:
 
 private:
 
-    css::uno::Reference< css::awt::XActionListener >  mxActionListener;
-
     void InitDialog();
 
+    std::unique_ptr<weld::CheckButton> mxCheckBox;
+
     sal_Int64 mnSourceSize;
     sal_Int64 mnDestSize;
     sal_Int64 mnApproxSize;
@@ -64,18 +49,4 @@ private:
     const OUString& maSaveAsURL;
 };
 
-class OKActionListener : public ::cppu::WeakImplHelper< 
css::awt::XActionListener >
-{
-public:
-    explicit OKActionListener( UnoDialog& rDialog ) : mrDialog( rDialog ){}
-
-    virtual void SAL_CALL actionPerformed( const css::awt::ActionEvent& Event 
) override;
-    virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) 
override;
-private:
-
-    UnoDialog& mrDialog;
-};
-
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sdext/source/minimizer/optimizerdialog.cxx 
b/sdext/source/minimizer/optimizerdialog.cxx
index 2ab84a59c455..8b3baf2cc90d 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -586,7 +586,8 @@ bool OptimizerDialog::onFinish()
         Sequence< PropertyValue > lArguments{
             comphelper::makePropertyValue("Settings", 
GetConfigurationSequence()),
             comphelper::makePropertyValue("StatusDispatcher", 
GetStatusDispatcher()),
-            comphelper::makePropertyValue("DocumentFrame", GetFrame())
+            comphelper::makePropertyValue("DocumentFrame", GetFrame()),
+            comphelper::makePropertyValue("DialogParentWindow", 
m_xAssistant->GetXWindow())
         };
 
         ErrCode errorCode;
diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx 
b/sdext/source/minimizer/pppoptimizertoken.cxx
index e933bf1e967c..472992551b81 100644
--- a/sdext/source/minimizer/pppoptimizertoken.cxx
+++ b/sdext/source/minimizer/pppoptimizertoken.cxx
@@ -53,6 +53,7 @@ const TokenTable pTokenTableArray[] =
     { "FilterName",         TK_FilterName },
     { "Flags",              TK_Flags },
     { "DocumentFrame",      TK_DocumentFrame },
+    { "DialogParentWindow", TK_DialogParentWindow },
     { "Name",               TK_Name },
     { "Progress",           TK_Progress },
     { "Settings",           TK_Settings },
@@ -87,16 +88,16 @@ const TokenTable pTokenTableArray[] =
     { "STR_NO_OLE_OBJECTS_DESC",    STR_NO_OLE_OBJECTS_DESC },
     { "STR_SLIDES",                 STR_SLIDES },
     { "STR_SUMMARY",                STR_SUMMARY },
-    { "STR_AUTOMATICALLY_OPEN",     STR_AUTOMATICALLY_OPEN },
     { "STR_DELETE_SLIDES",          STR_DELETE_SLIDES },
     { "STR_OPTIMIZE_IMAGES",        STR_OPTIMIZE_IMAGES },
     { "STR_CREATE_REPLACEMENT",     STR_CREATE_REPLACEMENT },
     { "MY_SETTINGS",                STR_MY_SETTINGS },
     { "STR_OK",                     STR_OK },
-    { "STR_INFO_1",                 STR_INFO_1 },
-    { "STR_INFO_2",                 STR_INFO_2 },
-    { "STR_INFO_3",                 STR_INFO_3 },
-    { "STR_INFO_4",                 STR_INFO_4 },
+    { "STR_INFO_PRIMARY",           STR_INFO_PRIMARY },
+    { "STR_INFO_SECONDARY_1",       STR_INFO_SECONDARY_1 },
+    { "STR_INFO_SECONDARY_2",       STR_INFO_SECONDARY_2 },
+    { "STR_INFO_SECONDARY_3",       STR_INFO_SECONDARY_3 },
+    { "STR_INFO_SECONDARY_4",       STR_INFO_SECONDARY_4 },
     { "STR_DUPLICATING_PRESENTATION",STR_DUPLICATING_PRESENTATION },
     { "STR_DELETING_SLIDES",        STR_DELETING_SLIDES },
     { "STR_OPTIMIZING_GRAPHICS",    STR_OPTIMIZING_GRAPHICS },
diff --git a/sdext/source/minimizer/pppoptimizertoken.hxx 
b/sdext/source/minimizer/pppoptimizertoken.hxx
index 62b1b369045a..f665e82ece1c 100644
--- a/sdext/source/minimizer/pppoptimizertoken.hxx
+++ b/sdext/source/minimizer/pppoptimizertoken.hxx
@@ -32,6 +32,7 @@ enum PPPOptimizerTokenEnum
     TK_FilterName,
     TK_Flags,
     TK_DocumentFrame,
+    TK_DialogParentWindow,
     TK_Name,
     TK_Progress,
     TK_Settings,
@@ -66,16 +67,16 @@ enum PPPOptimizerTokenEnum
     STR_NO_OLE_OBJECTS_DESC,
     STR_SLIDES,
     STR_SUMMARY,
-    STR_AUTOMATICALLY_OPEN,
     STR_DELETE_SLIDES,
     STR_OPTIMIZE_IMAGES,
     STR_CREATE_REPLACEMENT,
     STR_MY_SETTINGS,
     STR_OK,
-    STR_INFO_1,
-    STR_INFO_2,
-    STR_INFO_3,
-    STR_INFO_4,
+    STR_INFO_PRIMARY,
+    STR_INFO_SECONDARY_1,
+    STR_INFO_SECONDARY_2,
+    STR_INFO_SECONDARY_3,
+    STR_INFO_SECONDARY_4,
     STR_DUPLICATING_PRESENTATION,
     STR_DELETING_SLIDES,
     STR_OPTIMIZING_GRAPHICS,
commit 1710de70aa6d6522e009b7ac00b1fa5dfe4d7705
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Dec 6 15:46:20 2022 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Dec 6 19:30:12 2022 +0000

    InformationDialog is a misleading name
    
    It's not the Minimizer dialog, it's the document frame that the dialog is
    associated with.
    
    Change-Id: Ifb7de8dc3fa5ffa5180dab17f9b327fe7296dd0f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143738
    Tested-by: Caolán McNamara <caol...@redhat.com>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sdext/source/minimizer/impoptimizer.cxx 
b/sdext/source/minimizer/impoptimizer.cxx
index 7de159177979..721d7ef51bfe 100644
--- a/sdext/source/minimizer/impoptimizer.cxx
+++ b/sdext/source/minimizer/impoptimizer.cxx
@@ -569,7 +569,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue 
>& rArguments )
         switch( TKGet( rArgument.Name ) )
         {
             case TK_StatusDispatcher : rArgument.Value >>= mxStatusDispatcher; 
break;
-            case TK_InformationDialog: rArgument.Value >>= 
mxInformationDialog; break;
+            case TK_DocumentFrame: rArgument.Value >>= mxDocumentFrame; break;
             case TK_Settings :
             {
                 css::uno::Sequence< css::beans::PropertyValue > aSettings;
@@ -655,7 +655,7 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue 
>& rArguments )
         mxModel->unlockControllers();
 
         // clearing undo stack:
-        Reference< XFrame > xFrame( xSelf.is() ? xSelf : mxInformationDialog );
+        Reference< XFrame > xFrame( xSelf.is() ? xSelf : mxDocumentFrame );
         if ( xFrame.is() )
         {
             DispatchURL(mxContext, ".uno:ClearUndoStack", xFrame);
@@ -671,9 +671,9 @@ void ImpOptimizer::Optimize( const Sequence< PropertyValue 
>& rArguments )
         }
     }
 
-    if ( mxInformationDialog.is() )
+    if ( mxDocumentFrame.is() )
     {
-        InformationDialog aInformationDialog( mxContext, mxInformationDialog, 
maSaveAsURL, mbOpenNewDocument, nSourceSize, nDestSize, nEstimatedFileSize );
+        InformationDialog aInformationDialog( mxContext, mxDocumentFrame, 
maSaveAsURL, mbOpenNewDocument, nSourceSize, nDestSize, nEstimatedFileSize );
         aInformationDialog.execute();
         SetStatusValue( TK_OpenNewDocument, Any( mbOpenNewDocument ) );
         DispatchStatus();
diff --git a/sdext/source/minimizer/impoptimizer.hxx 
b/sdext/source/minimizer/impoptimizer.hxx
index 6a52e94986a4..a7436f7cec92 100644
--- a/sdext/source/minimizer/impoptimizer.hxx
+++ b/sdext/source/minimizer/impoptimizer.hxx
@@ -51,7 +51,7 @@ private:
     OUString    maFilterName;
     bool        mbOpenNewDocument;
 
-    css::uno::Reference< css::frame::XFrame > mxInformationDialog;
+    css::uno::Reference< css::frame::XFrame > mxDocumentFrame;
 
     void Optimize();
 
diff --git a/sdext/source/minimizer/optimizerdialog.cxx 
b/sdext/source/minimizer/optimizerdialog.cxx
index 4b7e6f039988..2ab84a59c455 100644
--- a/sdext/source/minimizer/optimizerdialog.cxx
+++ b/sdext/source/minimizer/optimizerdialog.cxx
@@ -586,7 +586,7 @@ bool OptimizerDialog::onFinish()
         Sequence< PropertyValue > lArguments{
             comphelper::makePropertyValue("Settings", 
GetConfigurationSequence()),
             comphelper::makePropertyValue("StatusDispatcher", 
GetStatusDispatcher()),
-            comphelper::makePropertyValue("InformationDialog", GetFrame())
+            comphelper::makePropertyValue("DocumentFrame", GetFrame())
         };
 
         ErrCode errorCode;
diff --git a/sdext/source/minimizer/pppoptimizertoken.cxx 
b/sdext/source/minimizer/pppoptimizertoken.cxx
index 6062efa44f14..e933bf1e967c 100644
--- a/sdext/source/minimizer/pppoptimizertoken.cxx
+++ b/sdext/source/minimizer/pppoptimizertoken.cxx
@@ -52,7 +52,7 @@ const TokenTable pTokenTableArray[] =
     { "FileSizeSource",     TK_FileSizeSource },
     { "FilterName",         TK_FilterName },
     { "Flags",              TK_Flags },
-    { "InformationDialog",  TK_InformationDialog },
+    { "DocumentFrame",      TK_DocumentFrame },
     { "Name",               TK_Name },
     { "Progress",           TK_Progress },
     { "Settings",           TK_Settings },
diff --git a/sdext/source/minimizer/pppoptimizertoken.hxx 
b/sdext/source/minimizer/pppoptimizertoken.hxx
index 4f74e73319d6..62b1b369045a 100644
--- a/sdext/source/minimizer/pppoptimizertoken.hxx
+++ b/sdext/source/minimizer/pppoptimizertoken.hxx
@@ -31,7 +31,7 @@ enum PPPOptimizerTokenEnum
     TK_FileSizeSource,
     TK_FilterName,
     TK_Flags,
-    TK_InformationDialog,
+    TK_DocumentFrame,
     TK_Name,
     TK_Progress,
     TK_Settings,

Reply via email to