Tag: cws_src680_dba24c
User: fs      
Date: 2007-10-24 13:35:58+0000
Modified:
   dba/dbaccess/source/ui/dlg/sqlmessage.cxx

Log:
 when only one text is used, ensure the dialog is large enough

File Changes:

Directory: /dba/dbaccess/source/ui/dlg/
=======================================

File [changed]: sqlmessage.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/dlg/sqlmessage.cxx?r1=1.27.38.1&r2=1.27.38.2
Delta lines:  +11 -4
--------------------
--- sqlmessage.cxx      2007-09-18 13:42:07+0000        1.27.38.1
+++ sqlmessage.cxx      2007-10-24 13:35:55+0000        1.27.38.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: sqlmessage.cxx,v $
  *
- *  $Revision: 1.27.38.1 $
+ *  $Revision: 1.27.38.2 $
  *
- *  last change: $Author: fs $ $Date: 2007/09/18 13:42:07 $
+ *  last change: $Author: fs $ $Date: 2007/10/24 13:35:55 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -592,21 +592,28 @@
         // and center it horizontally
         m_aTitle.SetStyle( ( m_aTitle.GetStyle() & ~WB_LEFT ) | WB_CENTER );
 
+        Rectangle aInfoRect( m_aInfoImage.GetPosPixel(), 
m_aInfoImage.GetSizePixel() );
         // also, if it's not as high as the image ...
         if ( aPrimaryRect.GetHeight() < m_aInfoImage.GetSizePixel().Height() )
         {   // ... make it fit the image height
-            aPrimaryRect.Bottom() += m_aInfoImage.GetSizePixel().Height() - 
aPrimaryRect.GetHeight();
+            aPrimaryRect.Bottom() += aInfoRect.GetHeight() - 
aPrimaryRect.GetHeight();
             // and center it vertically
             m_aTitle.SetStyle( m_aTitle.GetStyle() | WB_VCENTER );
         }
+        else
+        {   // ... otherwise, center the image vertically, relative to the 
primary text
+            aInfoRect.Move( 0, ( aPrimaryRect.GetHeight() - 
aInfoRect.GetHeight() ) / 2 );
+            m_aInfoImage.SetPosSizePixel( aInfoRect.TopLeft(), 
aInfoRect.GetSize() );
+        }
 
         m_aTitle.SetPosSizePixel( aPrimaryRect.TopLeft(), 
aPrimaryRect.GetSize() );
     }
 
     // adjust dialog size accordingly
+    const Rectangle& rBottomTextRect( bHaveSecondaryText ? aSecondaryRect : 
aPrimaryRect );
     Size aBorderSize = LogicToPixel( Size( OUTER_MARGIN, OUTER_MARGIN ), 
MAP_APPFONT );
     Size aDialogSize( LogicToPixel( Size( DIALOG_WIDTH, 30 ), MAP_APPFONT ) );
-    aDialogSize.Height() = aSecondaryRect.Bottom() + aBorderSize.Height();
+    aDialogSize.Height() = rBottomTextRect.Bottom() + aBorderSize.Height();
     aDialogSize.Width() = aPrimaryRect.Right() + aBorderSize.Width();
 
        SetSizePixel( aDialogSize );




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to