[Libreoffice-commits] .: 2 commits - basic/source embeddedobj/source

Christina Rossmanith crossmanith at kemper.freedesktop.org
Tue Apr 12 11:43:12 PDT 2011


 basic/source/app/app.cxx                             |    2 --
 basic/source/runtime/iosys.cxx                       |   18 ------------------
 embeddedobj/source/commonembedding/embedobj.cxx      |    2 --
 embeddedobj/source/commonembedding/persistence.cxx   |    2 --
 embeddedobj/source/commonembedding/specialobject.cxx |   13 -------------
 embeddedobj/source/general/docholder.cxx             |    5 -----
 embeddedobj/source/inc/docholder.hxx                 |    2 --
 embeddedobj/source/msole/graphconvert.cxx            |    1 -
 embeddedobj/source/msole/olecomponent.cxx            |    6 ------
 embeddedobj/source/msole/oleembed.cxx                |    7 -------
 embeddedobj/source/msole/olemisc.cxx                 |    1 -
 embeddedobj/source/msole/olepersist.cxx              |   15 ---------------
 embeddedobj/source/msole/ownview.cxx                 |    6 ------
 13 files changed, 80 deletions(-)

New commits:
commit 5c621892f834422513caee4d96d6f335d4132589
Author: Christina Rossmanith <ChrRossmanith at web.de>
Date:   Tue Apr 12 20:42:03 2011 +0200

    Finished removal of _USE_UNO

diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 97106af..4901862 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -243,9 +243,7 @@ int BasicApp::Main( )
 
     try
     {
-#ifdef _USE_UNO
     uno::Reference< XContentProviderManager > xUcb = InitializeUCB();
-#endif
 
     {
         DirEntry aIniPath( Config::GetConfigName( Config::GetDefDirectory(), CUniString("testtool") ) );
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 9caeff7..8759f9d 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -171,8 +171,6 @@ void SbiStream::MapError()
     }
 }
 
-#ifdef _USE_UNO
-
 // TODO: Code is copied from daemons2/source/uno/asciiEncoder.cxx
 
 ::rtl::OUString findUserInDescription( const ::rtl::OUString& aDescription )
@@ -205,15 +203,11 @@ void SbiStream::MapError()
     return user;
 }
 
-#endif
-
-
 // Hack for #83750
 sal_Bool runsInSetup( void );
 
 sal_Bool needSecurityRestrictions( void )
 {
-#ifdef _USE_UNO
     static sal_Bool bNeedInit = sal_True;
     static sal_Bool bRetVal = sal_True;
 
@@ -290,9 +284,6 @@ sal_Bool needSecurityRestrictions( void )
     }
 
     return bRetVal;
-#else
-    return sal_False;
-#endif
 }
 
 // Returns sal_True if UNO is available, otherwise the old file
@@ -300,7 +291,6 @@ sal_Bool needSecurityRestrictions( void )
 // #89378 New semantic: Don't just ask for UNO but for UCB
 sal_Bool hasUno( void )
 {
-#ifdef _USE_UNO
     static sal_Bool bNeedInit = sal_True;
     static sal_Bool bRetVal = sal_True;
 
@@ -326,9 +316,6 @@ sal_Bool hasUno( void )
         }
     }
     return bRetVal;
-#else
-    return sal_False;
-#endif
 }
 
 
@@ -421,8 +408,6 @@ void OslStream::SetSize( sal_uIntPtr nSize )
 }
 
 
-#ifdef _USE_UNO
-
 class UCBStream : public SvStream
 {
     Reference< XInputStream >	xIS;
@@ -585,7 +570,6 @@ void	UCBStream::SetSize( sal_uIntPtr nSize )
     SetError( ERRCODE_IO_GENERAL );
 }
 
-#endif
 
 // Oeffnen eines Streams
 SbError SbiStream::Open
@@ -601,7 +585,6 @@ SbError SbiStream::Open
     String aStr( rName, gsl_getSystemTextEncoding() );
     String aNameStr = getFullPath( aStr );
 
-#ifdef _USE_UNO
     if( hasUno() )
     {
         Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
@@ -646,7 +629,6 @@ SbError SbiStream::Open
         }
     }
 
-#endif
     if( !pStrm )
     {
         pStrm = new OslStream( aNameStr, nStrmMode );
commit c0652ef108ad0de4536c51ca060724232d84ddb8
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Sun Apr 10 20:29:44 2011 +0200

    Remove commented code in libs-core/embeddedobj (partially)

diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 476dc80..fd8a9f5 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -93,8 +93,6 @@ sal_Int32 OCommonEmbeddedObject::ConvertVerbToState_Impl( sal_Int32 nVerb )
 void OCommonEmbeddedObject::Deactivate()
 {
     uno::Reference< util::XModifiable > xModif( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
-    //MBA if ( !xModif.is() )
-    //MBA    throw uno::RuntimeException();
 
     // no need to lock for the initialization
     uno::Reference< embed::XEmbeddedClient > xClientSite = m_xClientSite;
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index 0b32e69..fe6d000 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -552,7 +552,6 @@ uno::Reference< util::XCloseable > OCommonEmbeddedObject::LoadDocumentFromStorag
         aLoadArgs.put( "InputStream", xTempInpStream );
     }
 
-    // aLoadArgs.put( "AsTemplate", sal_True );
 
     aLoadArgs.merge( m_aDocMediaDescriptor, true );
 
@@ -1844,7 +1843,6 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt
     /*sal_Bool bElExists =*/ xNameAccess->hasByName( sEntName );
 
     m_bReadOnly = sal_False;
-//	sal_Int32 nStorageMode = embed::ElementModes::READWRITE;
 
     if ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) )
         SwitchOwnPersistence( xStorage, sEntName );
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx b/embeddedobj/source/commonembedding/specialobject.cxx
index cb54cc4..aaa8ebb 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -129,19 +129,6 @@ embed::VisualRepresentation SAL_CALL OSpecialEmbeddedObject::getPreferredVisualR
 
     // TODO: return for the aspect of the document
     embed::VisualRepresentation aVisualRepresentation;
-    /*
-    OSL_ENSURE( m_pDocHolder->GetComponent().is(), "Running or Active object has no component!\n" );
-    uno::Reference< datatransfer::XTransferable > xTransferable( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
-    if ( !xTransferable.is() )
-        throw uno::RuntimeException();
-
-    datatransfer::DataFlavor aDataFlavor(
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "application/x-openoffice-gdimetafile;windows_formatname=\"GDIMetaFile\"" )),
-            ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "GDIMetaFile" )),
-            ::getCppuType( (const uno::Sequence< sal_Int8 >*) NULL ) );
-
-    aVisualRepresentation.Data = xTransferable->getTransferData( aDataFlavor );
-    aVisualRepresentation.Flavor = aDataFlavor;*/
     return aVisualRepresentation;
 }
 
diff --git a/embeddedobj/source/general/docholder.cxx b/embeddedobj/source/general/docholder.cxx
index bbc9f8d..675ae8c 100644
--- a/embeddedobj/source/general/docholder.cxx
+++ b/embeddedobj/source/general/docholder.cxx
@@ -363,7 +363,6 @@ void DocumentHolder::ResizeWindows_Impl( const awt::Rectangle& aHatchRect )
                                   aHatchRect.Height - 2*HATCH_BORDER_WIDTH,
                                   awt::PosSize::POSSIZE );
 
-        // Window* pWindow = VCLUnoHelper::GetWindow( m_xOwnWindow );
 
         m_xHatchWindow->setPosSize( aHatchRect.X,
                                     aHatchRect.Y,
@@ -981,9 +980,6 @@ void DocumentHolder::SetComponent( const uno::Reference< util::XCloseable >& xDo
     }
 
     m_xComponent = xDoc;
-    // done outside currently uno::Reference < container::XChild > xChild( m_xComponent, uno::UNO_QUERY );
-    // done outside currently if ( xChild.is() && m_pEmbedObj )
-    // done outside currently 	xChild->setParent( m_pEmbedObj->getParent() );
 
     m_bReadOnly = bReadOnly;
     m_bAllowClosing = sal_False;
@@ -1022,7 +1018,6 @@ sal_Bool DocumentHolder::LoadDocToFrame( sal_Bool bInPlace )
             ::comphelper::NamedValueCollection aArgs;
             aArgs.put( "Model", m_xComponent );
             aArgs.put( "ReadOnly", m_bReadOnly );
-            //aArgs.put( "Hidden", sal_True );
             if ( bInPlace )
                 aArgs.put( "PluginMode", sal_Int16(1) );
             ::rtl::OUString sUrl;
diff --git a/embeddedobj/source/inc/docholder.hxx b/embeddedobj/source/inc/docholder.hxx
index 8d26ef2..b1ac54d 100644
--- a/embeddedobj/source/inc/docholder.hxx
+++ b/embeddedobj/source/inc/docholder.hxx
@@ -165,8 +165,6 @@ public:
 
     void Show();
 
-    // sal_Bool SetVisArea( sal_Int64 nAspect, const ::com::sun::star::awt::Rectangle& aRect );
-    // sal_Bool GetVisArea( sal_Int64 nAspect, ::com::sun::star::awt::Rectangle *pRect );
     sal_Bool SetExtent( sal_Int64 nAspect, const ::com::sun::star::awt::Size& aSize );
     sal_Bool GetExtent( sal_Int64 nAspect, ::com::sun::star::awt::Size *pSize );
 
diff --git a/embeddedobj/source/msole/graphconvert.cxx b/embeddedobj/source/msole/graphconvert.cxx
index e8a6e99..bd178f0 100644
--- a/embeddedobj/source/msole/graphconvert.cxx
+++ b/embeddedobj/source/msole/graphconvert.cxx
@@ -73,7 +73,6 @@ sal_Bool ConvertBufferToFormat( void* pBuf,
                 if( xGraphic.is() )
                 {
                     SvMemoryStream aNewStream( 65535, 65535 );
-//					uno::Reference < io::XOutputStream > xOut = new utl::OOutputStreamHelper( aNewStream.GetLockBytes() );
                     uno::Reference < io::XStream > xOut = new utl::OStreamWrapper( aNewStream );				
                     uno::Sequence< beans::PropertyValue > aOutMediaProperties( 2 );
                     aOutMediaProperties[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "OutputStream" ));
diff --git a/embeddedobj/source/msole/olecomponent.cxx b/embeddedobj/source/msole/olecomponent.cxx
index a926336..e6ccd6a 100644
--- a/embeddedobj/source/msole/olecomponent.cxx
+++ b/embeddedobj/source/msole/olecomponent.cxx
@@ -680,8 +680,6 @@ sal_Bool OleComponent::InitializeObject_Impl()
     if ( FAILED( hr ) || !m_pNativeImpl->m_pViewObject2 )
         return sal_False;
 
-    // not realy needed for now, since object is updated on saving
-    // m_pNativeImpl->m_pViewObject2->SetAdvise( DVASPECT_CONTENT, 0, m_pImplAdviseSink );
 
     // remove all the caches
     IOleCache* pIOleCache = NULL;
@@ -746,8 +744,6 @@ void OleComponent::LoadEmbeddedObject( const ::rtl::OUString& aTempURL )
     hr = OleLoad( m_pNativeImpl->m_pIStorage, IID_IUnknown, NULL, (void**)&m_pNativeImpl->m_pObj );
     if ( FAILED( hr ) || !m_pNativeImpl->m_pObj )
     {
-        // STATSTG aStat;
-        // m_pNativeImpl->m_pIStorage->Stat( &aStat, STATFLAG_NONAME );
         throw uno::RuntimeException();
     }
 
@@ -1350,8 +1346,6 @@ void OleComponent::StoreOwnTmpIfNecessary()
         if ( FAILED( hr ) && hr != E_UNEXPECTED )
             throw io::IOException(); // TODO
 
-        // STATSTG aStat;
-        // m_pNativeImpl->m_pIStorage->Stat( &aStat, STATFLAG_NONAME );
     }
 }
 
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index f017966..5db0267 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -521,7 +521,6 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState )
                     m_pOleComponent->CloseObject();
                 }
 
-                // GetRidOfComponent();
                 aGuard.clear();
                 StateChangeNotification_Impl( sal_False, nOldState, m_nObjectState );
                 aGuard.reset();
@@ -700,7 +699,6 @@ namespace
 
     //Dump the objects content to a tempfile, just the "CONTENTS" stream if
     //there is one for non-compound documents, otherwise the whole content.
-    //
     //On success a file is returned which must be removed by the caller
     rtl::OUString lcl_ExtractObject(::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory,
         ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xObjectStream)
@@ -834,8 +832,6 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
             throw;
         }
 
-        // the following notification will be done asynchronously
-        // StateChangeNotification_Impl( sal_False, nOldState, m_nObjectState );
     }
     else
 #endif
@@ -1093,9 +1089,6 @@ sal_Int64 SAL_CALL OleEmbeddedObject::getStatus( sal_Int64
         nResult = m_nStatus;
     else if ( m_pOleComponent )
     {
-        // OLE should allow to get status even in loaded state
-        // if ( m_nObjectState == embed::EmbedStates::LOADED )
-        //	changeState( m_nObjectState == embed::EmbedStates::RUNNING );
 
         m_nStatus = m_pOleComponent->GetMiscStatus( nAspect );
         m_nStatusAspect = nAspect;
diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx
index bf53a25..0df2b84 100644
--- a/embeddedobj/source/msole/olemisc.cxx
+++ b/embeddedobj/source/msole/olemisc.cxx
@@ -663,7 +663,6 @@ void SAL_CALL OleEmbeddedObject::translateAccelerators(
     }
     // end wrapping related part ====================
 
-    // throw embed::WrongStateException();
 }
 
 // XChild
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 79c0ae1..0def17c 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -330,8 +330,6 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl(
         return xStream;
     }
 
-//	sal_Bool bSetSizeToRepl = sal_False;
-//	awt::Size aSizeToSet;
 
     sal_uInt32 nHeaderOffset = 0;
     if ( ( nRead >= 8 && aData[0] == -1 && aData[1] == -1 && aData[2] == -1 && aData[3] == -1 )
@@ -352,19 +350,6 @@ uno::Reference< io::XStream > OleEmbeddedObject::TryToGetAcceptableFormat_Impl(
             nHeaderOffset += nLen - 4;
         }
 
-//		if ( aData[4] == 3 )
-//		{
-//			try
-//			{
-//
-//				aSizeToSet = getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
-//				aSizeToSet.Width /= 364; //2540; // let the size be in inches, as wmf requires
-//				aSizeToSet.Height /= 364; //2540; // let the size be in inches, as wmf requires
-//				bSetSizeToRepl = sal_True;
-//			}
-//			catch( uno::Exception& )
-//			{}
-//		}
     }
     else if ( nRead > 4 )
     {
diff --git a/embeddedobj/source/msole/ownview.cxx b/embeddedobj/source/msole/ownview.cxx
index 7924e69..2bcd14f 100644
--- a/embeddedobj/source/msole/ownview.cxx
+++ b/embeddedobj/source/msole/ownview.cxx
@@ -302,12 +302,6 @@ sal_Bool OwnView_Impl::ReadContentsAndGenerateTempFile( const uno::Reference< io
         // read the complete size of the Object Package
         if ( xInStream->readBytes( aReadSeq, 4 ) != 4 )
             return sal_False;
-/*
-        sal_uInt32 nLength = (sal_uInt8)aReadSeq[0]
-                            + (sal_uInt8)aReadSeq[1] * 0x100
-                            + (sal_uInt8)aReadSeq[2] * 0x10000
-                            + (sal_uInt8)aReadSeq[3] * 0x1000000;
-*/
         // read the first header ( have no idea what does this header mean )
         if ( xInStream->readBytes( aReadSeq, 2 ) != 2 || aReadSeq[0] != 2 || aReadSeq[1] != 0 )
             return sal_False;


More information about the Libreoffice-commits mailing list