User: obo     
Date: 05/03/15 03:33:03

Modified:
 /dba/dbaccess/source/core/dataaccess/
  documentdefinition.cxx

Log:
 INTEGRATION: CWS mav17 (1.19.28); FILE MERGED
 2005/03/02 17:53:21 mav 1.19.28.4: RESYNC: (1.19-1.20); FILE MERGED
 2005/02/23 08:39:46 mav 1.19.28.3: #i35991# let the existing form be opened 
with the same size and in nonmodified state
 2005/02/23 08:33:12 mav 1.19.28.2: #i35991# let the existing form be opened 
with the same size and in nonmodified state
 2005/02/23 08:24:40 mav 1.19.28.1: #i35991# let the existing form be opened 
with the same size and in nonmodified state

File Changes:

Directory: /dba/dbaccess/source/core/dataaccess/
================================================

File [changed]: documentdefinition.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentdefinition.cxx?r1=1.21&r2=1.22
Delta lines:  +64 -2
--------------------
--- documentdefinition.cxx      10 Mar 2005 16:35:30 -0000      1.21
+++ documentdefinition.cxx      15 Mar 2005 11:33:00 -0000      1.22
@@ -86,6 +86,9 @@
 #ifndef _COM_SUN_STAR_AWT_XTOPWINDOW_HPP_
 #include <com/sun/star/awt/XTopWindow.hpp>
 #endif
+#ifndef _COM_SUN_STAR_AWT_SIZE_HPP_
+#include <com/sun/star/awt/Size.hpp>
+#endif
 #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
 #include <com/sun/star/lang/DisposedException.hpp>
 #endif
@@ -221,6 +224,9 @@
 #ifndef _COM_SUN_STAR_TASK_XINTERACTIONDISAPPROVE_HPP_
 #include <com/sun/star/task/XInteractionDisapprove.hpp>
 #endif
+#ifndef _DRAFTS_COM_SUN_STAR_FRAME_XLAYOUTMANAGER_HPP_
+#include <drafts/com/sun/star/frame/XLayoutManager.hpp>
+#endif
 #ifndef _CPPUHELPER_COMPBASE1_HXX_
 #include <cppuhelper/compbase1.hxx>
 #endif
@@ -663,11 +669,13 @@
                                        
                                                // object is new, so we an 
interceptor for save
                                                
xModel.set(getComponent(),UNO_QUERY);
+                                               Reference< XFrame > xFrame;
                                                if ( xModel.is() )
                                                {
+                                                       xFrame = 
xModel->getCurrentController()->getFrame();
+
                                                        if ( m_xListener.is() )
                                                        {
-                                                               
Reference<XFrame> xFrame = xModel->getCurrentController()->getFrame();
                                                                if ( 
xFrame.is() )
                                                                {
                                                                        
Reference<XTopWindow> xTopWindow( xFrame->getContainerWindow(),UNO_QUERY );
@@ -684,7 +692,6 @@
                                                                // remove the 
frame from the desktop because we need full control of it.
                                                                if ( 
m_xFrameLoader.is() )
                                                                {
-                                                                       
Reference<XFrame> xFrame = xModel->getCurrentController()->getFrame();
                                                                        
Reference<XFramesSupplier> xSup(m_xFrameLoader,UNO_QUERY);
                                                                        if ( 
xSup.is() )
                                                                        {
@@ -704,6 +711,36 @@
                                                                        
Reference<XPropertySet> xProp = xViewSup->getViewSettings();
                                                                        if ( 
xProp.is() )
                                                                        {
+                                                                               
// The visual area size can be changed by the setting of the following 
properties
+                                                                               
// so it should be restored later
+                                                                               
Reference< XVisualObject > xVisObj( xModel, UNO_QUERY );
+                                                                               
::com::sun::star::awt::Size aOrigSize;
+                                                                               
if ( xVisObj.is() )
+                                                                               
{
+                                                                               
        try {
+                                                                               
                aOrigSize = xVisObj->getVisualAreaSize( Aspects::MSOLE_CONTENT 
);
+                                                                               
        } catch ( Exception& )
+                                                                               
        {}
+                                                                               
}
+
+                                                                               
// Layout manager should not layout while the size is still not restored
+                                                                               
// so it will stay locked for this time
+                                                                               
Reference< ::drafts::com::sun::star::frame::XLayoutManager > xLayoutManager;
+                                                                               
if ( xFrame.is() )
+                                                                               
{
+                                                                               
        try
+                                                                               
        {
+                                                                               
                Reference< XPropertySet > xPropSet( xFrame, UNO_QUERY_THROW );
+                                                                               
                xLayoutManager.set( xPropSet->getPropertyValue( rtl::OUString( 
RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" ) ) ), UNO_QUERY );
+                                                                               
                if ( xLayoutManager.is() )
+                                                                               
                        xLayoutManager->lock();
+
+                                                                               
        }
+                                                                               
        catch( Exception& )
+                                                                               
        {}
+                                                                               
}
+
+                                                                               
// setting of the visual properties
                                                                                
try
                                                                                
{
                                                                                
        
xProp->setPropertyValue(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowRulers")),makeAny(sal_True));
@@ -718,10 +755,35 @@
                                                                                
catch(Exception&)
                                                                                
{ 
                                                                                
}
+
+                                                                               
// setting of the ruler changes the visual area so it should be restored
+                                                                               
if ( xVisObj.is() && aOrigSize.Width && aOrigSize.Height )
+                                                                               
{
+                                                                               
        try
+                                                                               
        {
+                                                                               
                xVisObj->setVisualAreaSize( Aspects::MSOLE_CONTENT, aOrigSize );
+                                                                               
        } catch ( Exception& )
+                                                                               
        {}
+                                                                               
}
+
+                                                                               
// setting of the visual area set the form to modified state, it should be 
restored
+                                                                               
try
+                                                                               
{
+                                                                               
        // unlock the layout manager
+                                                                               
        // and let it layout before setting of the modified state
+                                                                               
        if ( xLayoutManager.is() )
+                                                                               
                xLayoutManager->unlock();
+
+                                                                               
        Reference< XModifiable > xModif( xModel, UNO_QUERY_THROW );
+                                                                               
        xModif->setModified( sal_False );
+                                                                               
}
+                                                                               
catch( Exception& )
+                                                                               
{}
                                                                        }
                                     Reference<XModifiable> 
xModifiable(xModel,UNO_QUERY_THROW);
                                     xModifiable->setModified(sal_False);
                                                                }
+                                                       
                                                        }
                                                }
                                                fillReportData(!bOpenInDesign);




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

Reply via email to