[Libreoffice-commits] core.git: desktop/test include/toolkit odk/examples offapi/com offapi/type_reference offapi/UnoApi_offapi.mk qadevOOo/tests swext/mediawiki sw/source toolkit/source UnoControls/inc UnoControls/source

Ariel Constenla-Haile arielch at apache.org
Thu Jul 11 05:17:24 PDT 2013


 UnoControls/inc/basecontrol.hxx                                                 |    1 
 UnoControls/source/inc/progressmonitor.hxx                                      |    1 
 desktop/test/deployment/active/Dispatch.java                                    |    3 
 desktop/test/deployment/active/active_native.cxx                                |    2 
 desktop/test/deployment/active/active_python.py                                 |    3 
 desktop/test/deployment/passive/com/sun/star/comp/test/deployment/Dispatch.java |    3 
 desktop/test/deployment/passive/passive_native.cxx                              |    2 
 desktop/test/deployment/passive/passive_python.py                               |    3 
 include/toolkit/awt/vclxtoolkit.hxx                                             |    2 
 odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java                |    4 
 odk/examples/DevelopersGuide/GUI/MessageBox.java                                |    5 
 odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx                   |    3 
 odk/examples/java/Inspector/Inspector.java                                      |    3 
 offapi/UnoApi_offapi.mk                                                         |    3 
 offapi/com/sun/star/awt/MessageBoxButtons.idl                                   |    6 -
 offapi/com/sun/star/awt/MessageBoxCommand.idl                                   |   55 ---------
 offapi/com/sun/star/awt/MessageBoxResults.idl                                   |   58 ++++++++++
 offapi/com/sun/star/awt/MessageBoxType.idl                                      |   50 ++++++++
 offapi/com/sun/star/awt/XMessageBox.idl                                         |   35 +-----
 offapi/com/sun/star/awt/XMessageBoxFactory.idl                                  |   53 +++------
 offapi/type_reference/offapi.rdb                                                |binary
 qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java                            |    2 
 sw/source/ui/envelp/labimp.hxx                                                  |    1 
 swext/mediawiki/src/com/sun/star/wiki/Helper.java                               |    7 -
 swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java             |    4 
 toolkit/source/awt/vclxtoolkit.cxx                                              |   48 +++++++-
 26 files changed, 208 insertions(+), 149 deletions(-)

New commits:
commit 805c6101b3427cc98b53f1c48f22f705206c384d
Author: Ariel Constenla-Haile <arielch at apache.org>
Date:   Mon Dec 24 08:07:25 2012 +0000

    Resolves: #i121544# - Clean-up MessageBox API
    
    (cherry picked from commit 27cfcb1e9d103b3e49c1263b1fa59fee8b187b21)
    
    Conflicts:
    	desktop/test/deployment/active/active_native.cxx
    	desktop/test/deployment/passive/Dispatch.java
    	desktop/test/deployment/passive/passive_native.cxx
    	odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
    	odk/examples/DevelopersGuide/GUI/MessageBox.java
    	odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
    	odk/examples/java/Inspector/Inspector.java
    	offapi/com/sun/star/awt/MessageBoxButtons.idl
    	offapi/com/sun/star/awt/MessageBoxResults.idl
    	offapi/com/sun/star/awt/XMessageBox.idl
    	offapi/com/sun/star/awt/XMessageBoxFactory.idl
    	offapi/com/sun/star/awt/makefile.mk
    	offapi/type_reference/types.rdb
    	sdext/source/minimizer/unodialog.cxx
    	toolkit/inc/toolkit/awt/vclxtoolkit.hxx
    	toolkit/source/awt/vclxtoolkit.cxx
    	toolkit/source/layout/core/root.cxx
    
    Change-Id: I170b494fb96362bb25ba8d0f2518d4e46934dd67
    
    Related: #i121544# - Clean-up MessageBox API (post fix)
    
    (cherry picked from commit c9f7a06e7798bcd5253844c49d210ea9345bd4b8)
    
    Conflicts:
    	sw/inc/pch/precompiled_sw.hxx
    
    Change-Id: Ib8b1e7aaac769feff5206fcdd238c487a6130dd1
    
    Related: #i121544# - Fix header guards
    
    Found by: Tsutomu Uchino
    
    (cherry picked from commit 82194a19ff4f29c8451c8e6ab6fe4f1b9d08df27)
    
    Conflicts:
    	offapi/com/sun/star/awt/MessageBoxType.idl
    
    Change-Id: Ide8ba697fbc80395d2f30a068a0820a6afa3332f

diff --git a/UnoControls/inc/basecontrol.hxx b/UnoControls/inc/basecontrol.hxx
index 0aa633d..2ae330f 100644
--- a/UnoControls/inc/basecontrol.hxx
+++ b/UnoControls/inc/basecontrol.hxx
@@ -75,7 +75,6 @@
 #include <com/sun/star/awt/XComboBox.hpp>
 #include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/MessageBoxCommand.hpp>
 #include <com/sun/star/awt/XLayoutConstrains.hpp>
 #include <com/sun/star/awt/XProgressBar.hpp>
 #include <com/sun/star/awt/XTopWindow.hpp>
diff --git a/UnoControls/source/inc/progressmonitor.hxx b/UnoControls/source/inc/progressmonitor.hxx
index 163dc09..48bc2b9 100644
--- a/UnoControls/source/inc/progressmonitor.hxx
+++ b/UnoControls/source/inc/progressmonitor.hxx
@@ -55,7 +55,6 @@
 #include <com/sun/star/awt/XComboBox.hpp>
 #include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/MessageBoxCommand.hpp>
 #include <com/sun/star/awt/XLayoutConstrains.hpp>
 #include <com/sun/star/awt/XProgressBar.hpp>
 
diff --git a/desktop/test/deployment/active/Dispatch.java b/desktop/test/deployment/active/Dispatch.java
index 08a7933..f50cdea 100644
--- a/desktop/test/deployment/active/Dispatch.java
+++ b/desktop/test/deployment/active/Dispatch.java
@@ -19,6 +19,7 @@
 package com.sun.star.comp.test.deployment.active_java;
 
 import com.sun.star.awt.MessageBoxButtons;
+import com.sun.star.awt.MessageBoxType;
 import com.sun.star.awt.Rectangle;
 import com.sun.star.awt.XMessageBox;
 import com.sun.star.awt.XMessageBoxFactory;
@@ -69,7 +70,7 @@ public final class Dispatch extends WeakBase implements XServiceInfo, XDispatch
                             smgr.createInstanceWithContext(
                                 "com.sun.star.frame.Desktop", context)).
                          getCurrentFrame().getComponentWindow())),
-                    new Rectangle(), "infobox", MessageBoxButtons.BUTTONS_OK,
+                    MessageBoxType.INFOBOX, MessageBoxButtons.BUTTONS_OK,
                     "active", "java");
             box.execute();
             UnoRuntime.queryInterface(XComponent.class, box).dispose();
diff --git a/desktop/test/deployment/active/active_native.cxx b/desktop/test/deployment/active/active_native.cxx
index 3afc099..2242c6b 100644
--- a/desktop/test/deployment/active/active_native.cxx
+++ b/desktop/test/deployment/active/active_native.cxx
@@ -223,7 +223,7 @@ void Dispatch::dispatch(
     css::uno::Reference< css::awt::XMessageBox > box(
         xToolkit->createMessageBox(
             xWindowPeer,
-            css::awt::Rectangle(), "infobox",
+            css::awt::MessageBoxType_INFOBOX,
             css::awt::MessageBoxButtons::BUTTONS_OK, "active", "native"),
         css::uno::UNO_SET_THROW);
 
diff --git a/desktop/test/deployment/active/active_python.py b/desktop/test/deployment/active/active_python.py
index f52962e..7f6e5bb 100644
--- a/desktop/test/deployment/active/active_python.py
+++ b/desktop/test/deployment/active/active_python.py
@@ -21,6 +21,7 @@ import unohelper
 
 from com.sun.star.awt import Rectangle
 from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK
+from com.sun.star.awt.MessageBoxType import INFOBOX
 from com.sun.star.frame import XDispatch, XDispatchProvider
 from com.sun.star.lang import XServiceInfo
 from com.sun.star.registry import InvalidRegistryException
@@ -76,7 +77,7 @@ class Dispatch(unohelper.Base, XServiceInfo, XDispatch):
                 smgr.createInstanceWithContext( \
                     "com.sun.star.frame.Desktop", self.context). \
                     getCurrentFrame().getComponentWindow(), \
-                Rectangle(), "infobox", BUTTONS_OK, "active", "python")
+                INFOBOX, BUTTONS_OK, "active", "python")
         box.execute();
         box.dispose();
 
diff --git a/desktop/test/deployment/passive/com/sun/star/comp/test/deployment/Dispatch.java b/desktop/test/deployment/passive/com/sun/star/comp/test/deployment/Dispatch.java
index 762a09c..701fb31 100644
--- a/desktop/test/deployment/passive/com/sun/star/comp/test/deployment/Dispatch.java
+++ b/desktop/test/deployment/passive/com/sun/star/comp/test/deployment/Dispatch.java
@@ -19,6 +19,7 @@
 package com.sun.star.comp.test.deployment.passive_java;
 
 import com.sun.star.awt.MessageBoxButtons;
+import com.sun.star.awt.MessageBoxType;
 import com.sun.star.awt.Rectangle;
 import com.sun.star.awt.XMessageBox;
 import com.sun.star.awt.XMessageBoxFactory;
@@ -69,7 +70,7 @@ public final class Dispatch extends WeakBase implements XServiceInfo, XDispatch
                             smgr.createInstanceWithContext(
                                 "com.sun.star.frame.Desktop", context)).
                          getCurrentFrame().getComponentWindow())),
-                    new Rectangle(), "infobox", MessageBoxButtons.BUTTONS_OK,
+                    MessageBoxType.INFOBOX, MessageBoxButtons.BUTTONS_OK,
                     "passive", "java");
             box.execute();
             UnoRuntime.queryInterface(XComponent.class, box).dispose();
diff --git a/desktop/test/deployment/passive/passive_native.cxx b/desktop/test/deployment/passive/passive_native.cxx
index 819f6ab..93af8ab 100644
--- a/desktop/test/deployment/passive/passive_native.cxx
+++ b/desktop/test/deployment/passive/passive_native.cxx
@@ -220,7 +220,7 @@ void Dispatch::dispatch(
     css::uno::Reference< css::awt::XMessageBox > box(
         xToolkit->createMessageBox(
             xWindowPeer,
-            css::awt::Rectangle(), "infobox",
+            css::awt::MessageBoxType_INFOBOX,
             css::awt::MessageBoxButtons::BUTTONS_OK, "passive", "native"),
         css::uno::UNO_SET_THROW);
 
diff --git a/desktop/test/deployment/passive/passive_python.py b/desktop/test/deployment/passive/passive_python.py
index 1157f89..f16797e 100644
--- a/desktop/test/deployment/passive/passive_python.py
+++ b/desktop/test/deployment/passive/passive_python.py
@@ -21,6 +21,7 @@ import unohelper
 
 from com.sun.star.awt import Rectangle
 from com.sun.star.awt.MessageBoxButtons import BUTTONS_OK
+from com.sun.star.awt.MessageBoxType import INFOBOX
 from com.sun.star.frame import XDispatch, XDispatchProvider
 from com.sun.star.lang import XServiceInfo
 
@@ -75,7 +76,7 @@ class Dispatch(unohelper.Base, XServiceInfo, XDispatch):
                 smgr.createInstanceWithContext( \
                     "com.sun.star.frame.Desktop", self.context). \
                     getCurrentFrame().getComponentWindow(), \
-                Rectangle(), "infobox", BUTTONS_OK, "passive", "python")
+                INFOBOX, BUTTONS_OK, "passive", "python")
         box.execute();
         box.dispose();
 
diff --git a/include/toolkit/awt/vclxtoolkit.hxx b/include/toolkit/awt/vclxtoolkit.hxx
index 0004596..9393f10 100644
--- a/include/toolkit/awt/vclxtoolkit.hxx
+++ b/include/toolkit/awt/vclxtoolkit.hxx
@@ -126,7 +126,7 @@ public:
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL createSystemChild( const ::com::sun::star::uno::Any& Parent, const ::com::sun::star::uno::Sequence< sal_Int8 >& ProcessId, sal_Int16 SystemType ) throw(::com::sun::star::uno::RuntimeException);
 
     // ::com::sun::star::awt::XMessageBoxFactory
-    virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL createMessageBox( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent, const ::com::sun::star::awt::Rectangle& aPosSize, const OUString& aType, ::sal_Int32 aButtons, const OUString& aTitle, const OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException);
+    virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL createMessageBox( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent, ::com::sun::star::awt::MessageBoxType eType, ::sal_Int32 aButtons, const OUString& aTitle, const OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException);
 
     // ::com::sun::star::awt::XDataTransfer
     ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragGestureRecognizer > SAL_CALL getDragGestureRecognizer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& window ) throw(::com::sun::star::uno::RuntimeException);
diff --git a/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java b/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
index 5c10a0f..d544d03 100644
--- a/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
+++ b/odk/examples/DevelopersGuide/Charts/SelectionChangeListener.java
@@ -56,6 +56,7 @@ import com.sun.star.awt.Point;
 import com.sun.star.awt.Rectangle;
 import com.sun.star.awt.Size;
 import com.sun.star.awt.XMessageBoxFactory;
+import com.sun.star.awt.MessageBoxType;
 import com.sun.star.awt.XWindow;
 
 // __________ Implementation __________
@@ -204,10 +205,9 @@ public class SelectionChangeListener implements XSelectionChangeListener {
             XWindow xWin = aDesktop.getCurrentFrame().getContainerWindow();
             XWindowPeer aWinPeer = UnoRuntime.queryInterface(XWindowPeer.class, xWin);
 
-            Rectangle aRect = new Rectangle();
             int button = com.sun.star.awt.MessageBoxButtons.BUTTONS_OK;
             XMessageBoxFactory aMBF = UnoRuntime.queryInterface(XMessageBoxFactory.class, aToolKit);
-            XMessageBox xMB = aMBF.createMessageBox(aWinPeer, aRect, "infobox" , button, "Event-Notify", "Listener was called, selcetion has changed");
+            XMessageBox xMB = aMBF.createMessageBox(aWinPeer, MessageBoxType.INFOBOX, button, "Event-Notify", "Listener was called, selcetion has changed");
             xMB.execute();
         }
     }
diff --git a/odk/examples/DevelopersGuide/GUI/MessageBox.java b/odk/examples/DevelopersGuide/GUI/MessageBox.java
index 90cf5c8..bcc04bc 100644
--- a/odk/examples/DevelopersGuide/GUI/MessageBox.java
+++ b/odk/examples/DevelopersGuide/GUI/MessageBox.java
@@ -33,6 +33,7 @@
  *************************************************************************/
 
 import com.sun.star.awt.Rectangle;
+import com.sun.star.awt.MessageBoxType;
 import com.sun.star.awt.XMessageBox;
 import com.sun.star.awt.XMessageBoxFactory;
 import com.sun.star.awt.XVclWindowPeer;
@@ -173,9 +174,7 @@ public class MessageBox  {
         try {
             Object oToolkit = m_xMCF.createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext);
             XMessageBoxFactory xMessageBoxFactory = UnoRuntime.queryInterface(XMessageBoxFactory.class, oToolkit);
-            // rectangle may be empty if position is in the center of the parent peer
-            Rectangle aRectangle = new Rectangle();
-            XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox(_xParentWindowPeer, aRectangle, "errorbox", com.sun.star.awt.MessageBoxButtons.BUTTONS_OK, _sTitle, _sMessage);
+            XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox(_xParentWindowPeer, MessageBoxType.ERRORBOX, com.sun.star.awt.MessageBoxButtons.BUTTONS_OK, _sTitle, _sMessage);
             xComponent = UnoRuntime.queryInterface(XComponent.class, xMessageBox);
             if (xMessageBox != null){
                 short nResult = xMessageBox.execute();
diff --git a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
index 057fe46..d13da53 100644
--- a/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
+++ b/odk/examples/cpp/complextoolbarcontrols/MyProtocolHandler.cxx
@@ -53,8 +53,7 @@ void BaseDispatch::ShowMessageBox( const Reference< XFrame >& rFrame, const ::rt
     {
         Reference< XMessageBox > xMsgBox = xMsgBoxFactory->createMessageBox(
             Reference< XWindowPeer >( rFrame->getContainerWindow(), UNO_QUERY ),
-            Rectangle(0,0,300,200),
-            rtl::OUString( "infobox" ),
+            com::sun::star::awt::MessageBoxType_INFOBOX,
             MessageBoxButtons::BUTTONS_OK,
             aTitle,
             aMsgText );
diff --git a/odk/examples/java/Inspector/Inspector.java b/odk/examples/java/Inspector/Inspector.java
index b1b3851..fd9954d 100644
--- a/odk/examples/java/Inspector/Inspector.java
+++ b/odk/examples/java/Inspector/Inspector.java
@@ -192,8 +192,7 @@ public class Inspector{
         try {
             Object oToolkit = m_xComponentContext.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit", m_xComponentContext);
             XMessageBoxFactory xMessageBoxFactory = UnoRuntime.queryInterface(XMessageBoxFactory.class, oToolkit);
-            Rectangle aRectangle = new Rectangle();
-            XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox(_xWindowPeer, aRectangle, "errorbox", com.sun.star.awt.MessageBoxButtons.BUTTONS_OK, _sTitle, _sMessage);
+            XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox(_xWindowPeer, com.sun.star.awt.MessageBoxType.ERRORBOX, com.sun.star.awt.MessageBoxButtons.BUTTONS_OK, _sTitle, _sMessage);
             XComponent xComponent = UnoRuntime.queryInterface(XComponent.class, xMessageBox);
             if (xMessageBox != null){
                 short nResult = xMessageBox.execute();
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index c743345..495eea6 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -1745,7 +1745,8 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/awt,\
 	MenuItemStyle \
 	MenuItemType \
 	MessageBoxButtons \
-	MessageBoxCommand \
+	MessageBoxResults \
+	MessageBoxType \
 	MouseButton \
 	MouseEvent \
 	MouseWheelBehavior \
diff --git a/offapi/com/sun/star/awt/MessageBoxButtons.idl b/offapi/com/sun/star/awt/MessageBoxButtons.idl
index 729f603..a893cf7 100644
--- a/offapi/com/sun/star/awt/MessageBoxButtons.idl
+++ b/offapi/com/sun/star/awt/MessageBoxButtons.idl
@@ -19,9 +19,7 @@
 #ifndef __com_sun_star_awt_MessageBoxButtons_idl__
 #define __com_sun_star_awt_MessageBoxButtons_idl__
 
-
- module com {  module sun {  module star {  module awt {
-
+module com {  module sun {  module star {  module awt {
 
 /** defines constants for the possible message box button
     combinations.
@@ -29,7 +27,6 @@
  */
 constants MessageBoxButtons
 {
-
     /** specifies a message with "OK" button.
      */
     const long BUTTONS_OK                   = 1;
@@ -79,7 +76,6 @@ constants MessageBoxButtons
     const long DEFAULT_BUTTON_IGNORE        = 0x60000;
 };
 
-
 }; }; }; };
 
 #endif
diff --git a/offapi/com/sun/star/awt/MessageBoxCommand.idl b/offapi/com/sun/star/awt/MessageBoxResults.idl
similarity index 54%
copy from offapi/com/sun/star/awt/MessageBoxCommand.idl
copy to offapi/com/sun/star/awt/MessageBoxResults.idl
index 2483d00..9757086 100644
--- a/offapi/com/sun/star/awt/MessageBoxCommand.idl
+++ b/offapi/com/sun/star/awt/MessageBoxResults.idl
@@ -16,38 +16,41 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef __com_sun_star_awt_MessageBoxCommand_idl__
-#define __com_sun_star_awt_MessageBoxCommand_idl__
 
+#ifndef __com_sun_star_awt_MessageBoxResults_idl__
+#define __com_sun_star_awt_MessageBoxResults_idl__
 
+module com {  module sun {  module star {  module awt {
 
- module com {  module sun {  module star {  module awt {
-
-
-/** specifies a message box command.
-
-    @deprecated
+/** These constants are used to specify a result of executing a <type>XMessageBox</type>.
  */
-published constants MessageBoxCommand
+constants MessageBoxResults
 {
+    /** The user canceled the <type>XMessageBox</type>, by pressing "Cancel" or "Abort" button.
+     */
+    const short CANCEL  = 0;
 
-    const short CANCEL = 0;
-
-
-    const short OK = 1;
+    /** The user pressed the "Ok" button.
+     */
+    const short OK      = 1;
 
+    /** The user pressed the "Yes" button.
+     */
+    const short YES     = 2;
 
-    const short YES = 2;
+    /** The user pressed the "No" button.
+     */
+    const short NO      = 3;
 
+    /** The user pressed the "Retry" button.
+     */
+    const short RETRY   = 4;
 
-    const short NO = 3;
-
-
-    const short RETRY = 4;
-
+    /** The user pressed the "Ignore" button.
+     */
+    const short IGNORE  = 5;
 };
 
-
 }; }; }; };
 
 #endif
diff --git a/offapi/com/sun/star/awt/MessageBoxCommand.idl b/offapi/com/sun/star/awt/MessageBoxType.idl
similarity index 57%
rename from offapi/com/sun/star/awt/MessageBoxCommand.idl
rename to offapi/com/sun/star/awt/MessageBoxType.idl
index 2483d00..abb2913 100644
--- a/offapi/com/sun/star/awt/MessageBoxCommand.idl
+++ b/offapi/com/sun/star/awt/MessageBoxType.idl
@@ -1,4 +1,3 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -16,40 +15,36 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef __com_sun_star_awt_MessageBoxCommand_idl__
-#define __com_sun_star_awt_MessageBoxCommand_idl__
+#ifndef __com_sun_star_awt_MessageBoxType_idl__
+#define __com_sun_star_awt_MessageBoxType_idl__
 
+module com {  module sun {  module star {  module awt {
 
-
- module com {  module sun {  module star {  module awt {
-
-
-/** specifies a message box command.
-
-    @deprecated
+/** specifies the type of a <type>XMessageBox</type>.
  */
-published constants MessageBoxCommand
+published enum MessageBoxType
 {
+    /** A normal message box.
+     */
+    MESSAGEBOX,
 
-    const short CANCEL = 0;
-
-
-    const short OK = 1;
+    /** A message box to inform the user about a certain event
+     */
+    INFOBOX,
 
+    /** A message to warn the user about a certain problem.
+     */
+    WARNINGBOX,
 
-    const short YES = 2;
-
-
-    const short NO = 3;
-
-
-    const short RETRY = 4;
+    /** A message box to provide an error message to the user.
+     */
+    ERRORBOX,
 
+    /** A message box to query information from the user.
+     */
+    QUERYBOX
 };
 
-
 }; }; }; };
 
 #endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/com/sun/star/awt/XMessageBox.idl b/offapi/com/sun/star/awt/XMessageBox.idl
index ec9b4f0..070b8a8 100644
--- a/offapi/com/sun/star/awt/XMessageBox.idl
+++ b/offapi/com/sun/star/awt/XMessageBox.idl
@@ -21,45 +21,28 @@
 
 #include <com/sun/star/uno/XInterface.idl>
 
-
-
- module com {  module sun {  module star {  module awt {
-
+module com {  module sun {  module star {  module awt {
 
 /** gives access to a message box.
-
-    @deprecated
  */
-published interface XMessageBox: com::sun::star::uno::XInterface
+published interface XMessageBox
 {
-
-    /** sets the caption text.
-     */
-    void setCaptionText( [in] string aText );
-
-
-    /** returns the caption text.
+    /** the caption text.
      */
-    string getCaptionText();
+    [attribute] string CaptionText;
 
-
-    /** sets the message text.
-     */
-    void setMessageText( [in] string aText );
-
-
-    /** returns the message text.
+    /** the message text.
      */
-    string getMessageText();
-
+    [attribute] string MessageText;
 
     /** shows the message box.
+
+        @return
+            one of <type>MessageBoxResults</type>.
      */
     short execute();
-
 };
 
-
 }; }; }; };
 
 #endif
diff --git a/offapi/com/sun/star/awt/XMessageBoxFactory.idl b/offapi/com/sun/star/awt/XMessageBoxFactory.idl
index 1bef476..22b0b7b 100644
--- a/offapi/com/sun/star/awt/XMessageBoxFactory.idl
+++ b/offapi/com/sun/star/awt/XMessageBoxFactory.idl
@@ -23,63 +23,50 @@
 #include <com/sun/star/awt/XWindowPeer.idl>
 #include <com/sun/star/awt/XMessageBox.idl>
 #include <com/sun/star/awt/MessageBoxButtons.idl>
-#include <com/sun/star/awt/Rectangle.idl>
-
-
+#include <com/sun/star/awt/MessageBoxType.idl>
 
 module com { module sun { module star { module awt {
 
-
 /** specifies a factory interface for creating message boxes.
  */
 published interface XMessageBoxFactory : com::sun::star::uno::XInterface
 {
-
     /** creates a message box.
 
         @returns
-        the created message box or a null reference if it cannot be
-        created.
+            the created message box or a null reference if it cannot be
+            created.
 
         @param aParent
-        a valid XWindowPeer reference which is used as a parent. This parameter
-        must not be null.
+            a valid XWindowPeer reference which is used as a parent.
 
-        @param aPosSize
-        a rectangle which defines the position and size of the message
-        box in pixel.
+            <p>This parameter must not be null.</p>
 
         @param aType
-        a string which determines the message box type.
-        The following strings are defined.
-        <ul>
-            <li><b>infobox</b> A message box to inform the user about a certain event.
-                <b>Attention:</b><br/>This type of message box ignores the argument
-                aButton because a info box always shows a OK button.
-            </li>
-            <li><b>warningbox</b> A message to warn the user about a certain problem.</li>
-            <li><b>errorbox</b> A message box to provide an error message to the user.</li>
-            <li><b>querybox</b> A message box to query information from the user.</li>
-            <li><b>messbox</b> A normal message box.</li>
-        </ul>
+            the message box type.
 
         @param aButtons
-        specifies which buttons should be available on the
-        message box. A combination of
-        com::sun::star::awt::MessageBoxButtons. An <b>infobox</b>
-        ignores this parameter and always use button "OK".
+            specifies which buttons should be available on the message box.
+
+            <p>A combination of com::sun::star::awt::MessageBoxButtons</p>
+            <p>A com::sun::star::awt::MessageBoxType::INFOBOX
+            ignores this paramter, instead it uses a
+            com::sun::star::awt::MessageBoxButtons::BUTTONS_OK.</p>
 
         @param aTitle
-        specifies the title of the message box.
+                specifies the title of the message box.
 
         @param aMessage
-        specifies text which will be shown by the message box.
-        Line-breaks must be added using "CR" or "CR+LF".
+            specifies text which will be shown by the message box.
+            Line-breaks must be added using 'CR' or 'CR+LF'.
     */
-    XMessageBox createMessageBox( [in] com::sun::star::awt::XWindowPeer aParent, [in] com::sun::star::awt::Rectangle aPosSize, [in] string aType, [in] long aButtons, [in] string aTitle, [in] string aMessage );
+    XMessageBox createMessageBox( [in] com::sun::star::awt::XWindowPeer aParent,
+                                  [in] MessageBoxType eType,
+                                  [in] long nButtons,
+                                  [in] string sTitle,
+                                  [in] string sMessage );
 };
 
-
 }; }; }; };
 
 #endif
diff --git a/offapi/type_reference/offapi.rdb b/offapi/type_reference/offapi.rdb
index 06daf3b..7c06f1a 100644
Binary files a/offapi/type_reference/offapi.rdb and b/offapi/type_reference/offapi.rdb differ
diff --git a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
index a74faf6..9601c31 100644
--- a/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
+++ b/qadevOOo/tests/java/ifc/awt/_XMessageBoxFactory.java
@@ -47,7 +47,7 @@ public class _XMessageBoxFactory extends MultiMethodTest {
     public void _createMessageBox() {
         final XMessageBox mb = oObj.createMessageBox(
             (XWindowPeer) tEnv.getObjRelation("WINPEER"),
-            new Rectangle(0, 0, 100, 100), "errorbox", 1, "The Title",
+            com.sun.star.awt.MessageBoxType.ERRORBOX, 1, "The Title",
             "The Message");
         final UITools tools = new UITools(
             (XMultiServiceFactory) tParam.getMSF(),
diff --git a/sw/source/ui/envelp/labimp.hxx b/sw/source/ui/envelp/labimp.hxx
index da1fae1..b69ecb5 100644
--- a/sw/source/ui/envelp/labimp.hxx
+++ b/sw/source/ui/envelp/labimp.hxx
@@ -67,7 +67,6 @@
 #include <com/sun/star/awt/XComboBox.hpp>
 #include <com/sun/star/awt/XControl.hpp>
 #include <com/sun/star/awt/XCheckBox.hpp>
-#include <com/sun/star/awt/MessageBoxCommand.hpp>
 #include <com/sun/star/awt/XLayoutConstrains.hpp>
 #include <com/sun/star/awt/XProgressBar.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
diff --git a/swext/mediawiki/src/com/sun/star/wiki/Helper.java b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
index 345be2c..6b4044f 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/Helper.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/Helper.java
@@ -19,6 +19,7 @@
 package com.sun.star.wiki;
 
 import com.sun.star.awt.MessageBoxButtons;
+import com.sun.star.awt.MessageBoxType;
 import com.sun.star.awt.XControl;
 import com.sun.star.awt.XControlContainer;
 import com.sun.star.awt.XDialog;
@@ -980,8 +981,7 @@ public class Helper
                         {
                             xMB = xMBFactory.createMessageBox(
                                                      xParentPeer,
-                                                     new com.sun.star.awt.Rectangle(),
-                                                     "querybox",
+                                                     MessageBoxType.QUERYBOX,
                                                      MessageBoxButtons.BUTTONS_YES_NO | MessageBoxButtons.DEFAULT_BUTTON_NO,
                                                      sTitle,
                                                      sError );
@@ -990,8 +990,7 @@ public class Helper
                         {
                             xMB = xMBFactory.createMessageBox(
                                                      xParentPeer,
-                                                     new com.sun.star.awt.Rectangle(),
-                                                     "errorbox",
+                                                     MessageBoxType.ERRORBOX,
                                                      MessageBoxButtons.BUTTONS_OK,
                                                      sTitle,
                                                      sError );
diff --git a/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java b/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
index b0dfb38..4d25b79 100644
--- a/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
+++ b/swext/mediawiki/src/com/sun/star/wiki/MainThreadDialogExecutor.java
@@ -157,8 +157,8 @@ public class MainThreadDialogExecutor implements XCallback
         else if ( m_xMessageBox != null )
         {
             int nRes = m_xMessageBox.execute();
-            m_bResult = ( nRes == com.sun.star.awt.MessageBoxCommand.OK
-                          || nRes == com.sun.star.awt.MessageBoxCommand.YES );
+            m_bResult = ( nRes == com.sun.star.awt.MessageBoxResults.OK
+                          || nRes == com.sun.star.awt.MessageBoxResults.YES );
         }
 
         m_bCalled = true;
diff --git a/toolkit/source/awt/vclxtoolkit.cxx b/toolkit/source/awt/vclxtoolkit.cxx
index afe3eb1..881e41b 100644
--- a/toolkit/source/awt/vclxtoolkit.cxx
+++ b/toolkit/source/awt/vclxtoolkit.cxx
@@ -366,6 +366,47 @@ sal_uInt16 ImplGetComponentType( const String& rServiceName )
 }
 
 
+namespace
+{
+    struct MessageBoxTypeInfo
+    {
+        css::awt::MessageBoxType eType;
+        const sal_Char          *pName;
+        sal_Int32                nLen;
+    };
+
+    static MessageBoxTypeInfo aMessageBoxTypeInfo[] =
+    {
+        { css::awt::MessageBoxType_MESSAGEBOX,      RTL_CONSTASCII_STRINGPARAM("messbox") },
+        { css::awt::MessageBoxType_INFOBOX,         RTL_CONSTASCII_STRINGPARAM("infobox") },
+        { css::awt::MessageBoxType_WARNINGBOX,      RTL_CONSTASCII_STRINGPARAM("warningbox") },
+        { css::awt::MessageBoxType_ERRORBOX,        RTL_CONSTASCII_STRINGPARAM("errorbox") },
+        { css::awt::MessageBoxType_QUERYBOX,        RTL_CONSTASCII_STRINGPARAM("querybox") },
+        { css::awt::MessageBoxType_MAKE_FIXED_SIZE, 0, 0 }
+    };
+
+    static bool lcl_convertMessageBoxType(
+        rtl::OUString &sType,
+        css::awt::MessageBoxType eType )
+    {
+        const MessageBoxTypeInfo *pMap = aMessageBoxTypeInfo;
+        css::awt::MessageBoxType eVal = css::awt::MessageBoxType_MAKE_FIXED_SIZE;
+
+        while ( pMap->pName )
+        {
+            if ( pMap->eType == eType )
+            {
+                eVal = eType;
+                sType = rtl::OUString( pMap->pName, pMap->nLen, RTL_TEXTENCODING_ASCII_US );
+                break;
+            }
+            pMap++;
+        }
+
+        return ( eVal != css::awt::MessageBoxType_MAKE_FIXED_SIZE );
+    }
+}
+
 //  ----------------------------------------------------
 //  class VCLXToolkit
 //  ----------------------------------------------------
@@ -1214,8 +1255,7 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
 // ::com::sun::star::awt::XMessageBoxFactory
 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > SAL_CALL VCLXToolkit::createMessageBox(
     const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& aParent,
-    const ::com::sun::star::awt::Rectangle& aPosSize,
-    const OUString& aType,
+    ::com::sun::star::awt::MessageBoxType eType,
     ::sal_Int32 aButtons,
     const OUString& aTitle,
     const OUString& aMessage ) throw (::com::sun::star::uno::RuntimeException)
@@ -1256,11 +1296,13 @@ css::uno::Reference< css::awt::XWindowPeer > VCLXToolkit::ImplCreateWindow(
     if ( sal_Int32( aButtons & 0xffff0000L ) == css::awt::MessageBoxButtons::DEFAULT_BUTTON_IGNORE )
         nAddWinBits |= WB_DEF_IGNORE;
 
+    rtl::OUString aType;
+    lcl_convertMessageBoxType( aType, eType );
+
     aDescriptor.Type              = css::awt::WindowClass_MODALTOP;
     aDescriptor.WindowServiceName = aType;
     aDescriptor.ParentIndex       = -1;
     aDescriptor.Parent            = aParent;
-    aDescriptor.Bounds            = aPosSize;
     aDescriptor.WindowAttributes  = nWindowAttributes;
     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMessageBox > xMsgBox(
         ImplCreateWindow( aDescriptor, nAddWinBits ), css::uno::UNO_QUERY );


More information about the Libreoffice-commits mailing list