diff options
author | Joachim Lingner <jl@openoffice.org> | 2010-06-07 10:13:44 +0200 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2010-06-07 10:13:44 +0200 |
commit | e72806c26954f13eb025694dc54530de93d4dc6e (patch) | |
tree | 304d33fdf6ff170ff0d42a9d4ed15966a552ea65 | |
parent | 729f1a6606a24a74f9f606921da13ab703d334f5 (diff) | |
parent | d0520c036f295a90d1877e285998a02d514f856a (diff) |
jl152 merge with DEV300_m80
99 files changed, 1651 insertions, 835 deletions
diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx index 957b0a508bd8..cb2c4f6628c8 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControl.hxx @@ -56,7 +56,7 @@ protected: AccessibleGridControl( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxParent, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator, - ::svt::table::IAccessibleTable& _rTable + ::svt::table::IAccessibleTable& _rTable ); virtual ~AccessibleGridControl(); @@ -177,8 +177,7 @@ private: <p>The instance holds it's XAccessibleContext with a hard reference, while the contxt holds this instance weak.</p> */ -typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessible - > AccessibleGridControlAccess_Base; +typedef ::cppu::WeakImplHelper1 < ::com::sun::star::accessibility::XAccessible > AccessibleGridControlAccess_Base; class AccessibleGridControlAccess :public AccessibleGridControlAccess_Base ,public ::svt::table::IAccessibleTableControl @@ -191,7 +190,7 @@ private: ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > m_xContext; - AccessibleGridControl* m_pContext; + AccessibleGridControl* m_pContext; // note that this pointer is valid as long as m_xContext is valid! public: @@ -253,7 +252,7 @@ protected: private: AccessibleGridControlAccess(); // never implemented - AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented + AccessibleGridControlAccess( const AccessibleGridControlAccess& ); // never implemented AccessibleGridControlAccess& operator=( const AccessibleGridControlAccess& ); // never implemented }; diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx index 3bdd5abe8912..c6a26d8c4548 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlBase.hxx @@ -96,8 +96,8 @@ public: @param eDescrText The constant for the description text. */ AccessibleGridControlBase( const ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, ::svt::table::AccessibleTableControlObjType eObjType ); protected: @@ -135,14 +135,14 @@ public: The relation set (the GridControl does not have one). */ virtual ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL - getAccessibleRelationSet() + ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL + getAccessibleRelationSet() throw ( ::com::sun::star::uno::RuntimeException ); /** @return The set of current states. */ virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL - getAccessibleStateSet() + getAccessibleStateSet() throw ( ::com::sun::star::uno::RuntimeException ); /** @return The parent's locale. */ @@ -407,7 +407,7 @@ protected: private: GridControlAccessibleElement(); // never implemented - GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented + GridControlAccessibleElement( const GridControlAccessibleElement& ); // never implemented GridControlAccessibleElement& operator=( const GridControlAccessibleElement& ); // never implemented }; diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx index b45ad5bdae5a..90306435bd4b 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeader.hxx @@ -51,7 +51,7 @@ public: AccessibleGridControlHeader( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, + ::svt::table::IAccessibleTable& rTable, ::svt::table::AccessibleTableControlObjType eObjType ); protected: diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx index 648614a9e214..0672ca28a151 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlHeaderCell.hxx @@ -36,9 +36,9 @@ namespace accessibility sal_Int32 m_nColumnRowId; public: AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId, - const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& _rTable, - ::svt::table::AccessibleTableControlObjType _eObjType); + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& _rTable, + ::svt::table::AccessibleTableControlObjType _eObjType); /** @return The count of visible children. */ virtual sal_Int32 SAL_CALL getAccessibleChildCount() throw ( ::com::sun::star::uno::RuntimeException ); @@ -56,8 +56,8 @@ namespace accessibility /** Queries for a new interface. */ ::com::sun::star::uno::Any SAL_CALL queryInterface( - const ::com::sun::star::uno::Type& rType ) - throw ( ::com::sun::star::uno::RuntimeException ); + const ::com::sun::star::uno::Type& rType ) + throw ( ::com::sun::star::uno::RuntimeException ); /** Aquires the object (calls acquire() on base class). */ virtual void SAL_CALL acquire() throw (); diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx index 35b7a69f5aa6..28d9cfb919f1 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableBase.hxx @@ -57,9 +57,9 @@ public: @param eDescrText The constant for the description text. */ AccessibleGridControlTableBase( const ::com::sun::star::uno::Reference< - ::com::sun::star::accessibility::XAccessible >& rxParent, - ::svt::table::IAccessibleTable& rTable, - ::svt::table::AccessibleTableControlObjType eObjType ); + ::com::sun::star::accessibility::XAccessible >& rxParent, + ::svt::table::IAccessibleTable& rTable, + ::svt::table::AccessibleTableControlObjType eObjType ); protected: virtual ~AccessibleGridControlTableBase(); diff --git a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx index dd44927d7fc1..dd44927d7fc1 100644..100755 --- a/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleGridControlTableCell.hxx diff --git a/accessibility/source/extended/AccessibleGridControl.cxx b/accessibility/source/extended/AccessibleGridControl.cxx index e8111657d7d0..f0aa406b62bf 100644..100755 --- a/accessibility/source/extended/AccessibleGridControl.cxx +++ b/accessibility/source/extended/AccessibleGridControl.cxx @@ -33,7 +33,6 @@ #include <svtools/accessibletable.hxx> #include <comphelper/types.hxx> #include <toolkit/helper/vclunohelper.hxx> -//#include "svtools/table/tablecontrol.hxx" // ============================================================================ @@ -61,21 +60,19 @@ public: /** The data table child. */ Reference< ::com::sun::star::accessibility::XAccessible > m_xTable; - AccessibleGridControlTable* m_pTable; + AccessibleGridControlTable* m_pTable; /** The header bar for rows. */ Reference< ::com::sun::star::accessibility::XAccessible > m_xRowHeaderBar; - AccessibleGridControlHeader* m_pRowHeaderBar; + AccessibleGridControlHeader* m_pRowHeaderBar; /** The header bar for columns (first row of the table). */ Reference< ::com::sun::star::accessibility::XAccessible > m_xColumnHeaderBar; - AccessibleGridControlHeader* m_pColumnHeaderBar; + AccessibleGridControlHeader* m_pColumnHeaderBar; }; -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControl ) AccessibleGridControl::AccessibleGridControl( @@ -83,7 +80,6 @@ AccessibleGridControl::AccessibleGridControl( IAccessibleTable& _rTable ) : AccessibleGridControlBase( _rxParent, _rTable, TCTYPE_GRIDCONTROL ) { -// DBG_CTOR( AccessibleTableControl, NULL ); m_pImpl.reset( new AccessibleGridControl_Impl() ); m_pImpl->m_aCreator = _rxCreator; } @@ -91,7 +87,6 @@ AccessibleGridControl::AccessibleGridControl( // ----------------------------------------------------------------------------- AccessibleGridControl::~AccessibleGridControl() { - DBG_DTOR( AccessibleGridControl, NULL ); } // ----------------------------------------------------------------------------- @@ -99,7 +94,7 @@ void SAL_CALL AccessibleGridControl::disposing() { ::osl::MutexGuard aGuard( getOslMutex() ); - m_pImpl->m_pTable = NULL; + m_pImpl->m_pTable = NULL; m_pImpl->m_pColumnHeaderBar = NULL; m_pImpl->m_pRowHeaderBar = NULL; m_pImpl->m_aCreator = Reference< XAccessible >(); @@ -143,7 +138,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) { if(nChildIndex == 0 && m_aTable.HasColHeader()) { - if(!m_pImpl->m_xColumnHeaderBar.is()){ + if(!m_pImpl->m_xColumnHeaderBar.is()) + { AccessibleGridControlHeader* pColHeaderBar = new AccessibleGridControlHeader(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_COLUMNHEADERBAR); m_pImpl->m_xColumnHeaderBar = pColHeaderBar; } @@ -151,7 +147,8 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) } else if(m_aTable.HasRowHeader() && (nChildIndex == 1 || nChildIndex == 0)) { - if(!m_pImpl->m_xRowHeaderBar.is()){ + if(!m_pImpl->m_xRowHeaderBar.is()) + { AccessibleGridControlHeader* pRowHeaderBar = new AccessibleGridControlHeader(m_pImpl->m_aCreator, m_aTable, svt::table::TCTYPE_ROWHEADERBAR); m_pImpl->m_xRowHeaderBar = pRowHeaderBar; } @@ -164,7 +161,6 @@ AccessibleGridControl::getAccessibleChild( sal_Int32 nChildIndex ) xChild = m_pImpl->m_xTable; } } - return xChild; } // ----------------------------------------------------------------------------- @@ -200,11 +196,11 @@ AccessibleGridControl::getAccessibleAtPoint( const awt::Point& rPoint ) { Reference< XAccessible > xCurrChild( implGetFixedChild( nIndex ) ); Reference< XAccessibleComponent > - xCurrChildComp( xCurrChild, uno::UNO_QUERY ); + xCurrChildComp( xCurrChild, uno::UNO_QUERY ); if( xCurrChildComp.is() && - VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) - xChild = xCurrChild; + VCLRectangle( xCurrChildComp->getBounds() ).IsInside( aPoint ) ) + xChild = xCurrChild; } } return xChild; @@ -217,7 +213,7 @@ void SAL_CALL AccessibleGridControl::grabFocus() TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - m_aTable.GrabFocus(); + m_aTable.GrabFocus(); } // ----------------------------------------------------------------------------- @@ -260,7 +256,6 @@ Reference< XAccessible > AccessibleGridControl::implGetTable() { m_pImpl->m_pTable = createAccessibleTable(); m_pImpl->m_xTable = m_pImpl->m_pTable; - } return m_pImpl->m_xTable; } @@ -302,7 +297,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex ) Reference< XAccessible > xRet; switch( nChildIndex ) { - case TCINDEX_COLUMNHEADERBAR: + case TCINDEX_COLUMNHEADERBAR: xRet = implGetHeaderBar( TCTYPE_COLUMNHEADERBAR ); break; case TCINDEX_ROWHEADERBAR: @@ -318,7 +313,7 @@ AccessibleGridControl::implGetFixedChild( sal_Int32 nChildIndex ) AccessibleGridControlTable* AccessibleGridControl::createAccessibleTable() { Reference< XAccessible > xCreator = (Reference< XAccessible >)m_pImpl->m_aCreator; - DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" ); + DBG_ASSERT( xCreator.is(), "accessibility/extended/AccessibleGirdControl::createAccessibleTable: my creator died - how this?" ); return new AccessibleGridControlTable( xCreator, m_aTable, TCTYPE_TABLE ); } // ============================================================================ @@ -331,13 +326,11 @@ AccessibleGridControlAccess::AccessibleGridControlAccess( const Reference< XAcce ,m_rTable( _rTable ) ,m_pContext( NULL ) { - DBG_CTOR( AccessibleGridControlAccess, NULL ); } // ----------------------------------------------------------------------------- AccessibleGridControlAccess::~AccessibleGridControlAccess() { - DBG_DTOR( AccessibleGridControlAccess, NULL ); } // ----------------------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlBase.cxx b/accessibility/source/extended/AccessibleGridControlBase.cxx index 12d4a7d141a4..ea81bd350426 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlBase.cxx @@ -57,8 +57,6 @@ namespace accessibility { using namespace com::sun::star::accessibility::AccessibleStateType; // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlBase ) AccessibleGridControlBase::AccessibleGridControlBase( @@ -73,13 +71,10 @@ AccessibleGridControlBase::AccessibleGridControlBase( m_aDescription( rTable.GetAccessibleObjectDescription( eObjType ) ), m_aClientId(0) { - DBG_CTOR( AccessibleGridControlBase, NULL ); } AccessibleGridControlBase::~AccessibleGridControlBase() { -// DBG_DTOR( AccessibleGridControlBase, NULL ); - if( isAlive() ) { // increment ref count to prevent double call of Dtor @@ -122,20 +117,19 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getAccessibleIndexInParent() xParentContext( m_xParent->getAccessibleContext() ); if( xParentContext.is() ) { - Reference< uno::XInterface > xChild; + Reference< uno::XInterface > xChild; sal_Int32 nChildCount = xParentContext->getAccessibleChildCount(); for( sal_Int32 nChild = 0; nChild < nChildCount; ++nChild ) { - xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) ); - - if ( xMeMyselfAndI.get() == xChild.get() ) - { - nRet = nChild; - break; - } + xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) ); + if ( xMeMyselfAndI.get() == xChild.get() ) + { + nRet = nChild; + break; } } + } } return nRet; } @@ -160,9 +154,9 @@ Reference< XAccessibleRelationSet > SAL_CALL AccessibleGridControlBase::getAccessibleRelationSet() throw ( uno::RuntimeException ) { - ensureIsAlive(); - // GridControl does not have relations. - return new utl::AccessibleRelationSetHelper; + ensureIsAlive(); + // GridControl does not have relations. + return new utl::AccessibleRelationSetHelper; } Reference< XAccessibleStateSet > SAL_CALL @@ -185,7 +179,7 @@ lang::Locale SAL_CALL AccessibleGridControlBase::getLocale() Reference< XAccessibleContext > xParentContext( m_xParent->getAccessibleContext() ); if( xParentContext.is() ) - return xParentContext->getLocale(); + return xParentContext->getLocale(); } throw IllegalAccessibleComponentStateException(); } @@ -268,19 +262,18 @@ void SAL_CALL AccessibleGridControlBase::removeEventListener( { if( _rxListener.is() && getClientId( ) ) { - ::osl::MutexGuard aGuard( getOslMutex() ); + ::osl::MutexGuard aGuard( getOslMutex() ); sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( getClientId( ), _rxListener ); - if ( !nListenerCount ) - { - // no listeners anymore - // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), - // and at least to us not firing any events anymore, in case somebody calls - // NotifyAccessibleEvent, again - - AccessibleEventNotifier::TClientId nId( getClientId( ) ); - setClientId( 0 ); - AccessibleEventNotifier::revokeClient( nId ); - } + if ( !nListenerCount ) + { + // no listeners anymore + // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client), + // and at least to us not firing any events anymore, in case somebody calls + // NotifyAccessibleEvent, again + AccessibleEventNotifier::TClientId nId( getClientId( ) ); + setClientId( 0 ); + AccessibleEventNotifier::revokeClient( nId ); + } } } @@ -310,7 +303,6 @@ sal_Bool SAL_CALL AccessibleGridControlBase::supportsService( for( ; ( pString != pArrEnd ) && ( rServiceName != *pString ); ++pString ) ; - return pString != pArrEnd; } @@ -351,7 +343,6 @@ sal_Bool AccessibleGridControlBase::implIsShowing() } else pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); - return pStateSetHelper; } @@ -382,7 +373,7 @@ Rectangle AccessibleGridControlBase::getBoundingBox() } return aRect; } -// + Rectangle AccessibleGridControlBase::getBoundingBoxOnScreen() throw ( lang::DisposedException ) { @@ -436,22 +427,22 @@ sal_Int16 SAL_CALL AccessibleGridControlBase::getAccessibleRole() switch ( m_eObjType ) { case TCTYPE_ROWHEADERCELL: - nRole = AccessibleRole::ROW_HEADER; - break; - case TCTYPE_COLUMNHEADERCELL: - nRole = AccessibleRole::COLUMN_HEADER; - break; - case TCTYPE_COLUMNHEADERBAR: - case TCTYPE_ROWHEADERBAR: - case TCTYPE_TABLE: - nRole = AccessibleRole::TABLE; - break; - case TCTYPE_TABLECELL: - nRole = AccessibleRole::TABLE_CELL; - break; - case TCTYPE_GRIDCONTROL: - nRole = AccessibleRole::PANEL; - break; + nRole = AccessibleRole::ROW_HEADER; + break; + case TCTYPE_COLUMNHEADERCELL: + nRole = AccessibleRole::COLUMN_HEADER; + break; + case TCTYPE_COLUMNHEADERBAR: + case TCTYPE_ROWHEADERBAR: + case TCTYPE_TABLE: + nRole = AccessibleRole::TABLE; + break; + case TCTYPE_TABLECELL: + nRole = AccessibleRole::TABLE_CELL; + break; + case TCTYPE_GRIDCONTROL: + nRole = AccessibleRole::PANEL; + break; } return nRole; } @@ -480,17 +471,16 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getForeground( ) throw (::com::su { if ( pInst->IsControlForeground() ) nColor = pInst->GetControlForeground().GetColor(); + else + { + Font aFont; + if ( pInst->IsControlFont() ) + aFont = pInst->GetControlFont(); else - { - Font aFont; - if ( pInst->IsControlFont() ) - aFont = pInst->GetControlFont(); - else - aFont = pInst->GetFont(); - nColor = aFont.GetColor().GetColor(); - } + aFont = pInst->GetFont(); + nColor = aFont.GetColor().GetColor(); + } } - return nColor; } // ----------------------------------------------------------------------------- @@ -505,20 +495,18 @@ sal_Int32 SAL_CALL AccessibleGridControlBase::getBackground( ) throw (::com::su { if ( pInst->IsControlBackground() ) nColor = pInst->GetControlBackground().GetColor(); - else + else nColor = pInst->GetBackground().GetColor().GetColor(); } - return nColor; } //// ============================================================================ GridControlAccessibleElement::GridControlAccessibleElement( const Reference< XAccessible >& rxParent, - IAccessibleTable& rTable, - AccessibleTableControlObjType eObjType ) + IAccessibleTable& rTable, + AccessibleTableControlObjType eObjType ) :AccessibleGridControlBase( rxParent, rTable, eObjType ) { -// DBG_CTOR( GridControlAccessibleElement, NULL ); } // XInterface ----------------------------------------------------------------- @@ -537,7 +525,6 @@ Reference< XAccessibleContext > SAL_CALL GridControlAccessibleElement::getAccess // ---------------------------------------------------------------------------- GridControlAccessibleElement::~GridControlAccessibleElement( ) { -// DBG_DTOR( GridControlAccessibleElement, NULL ); } // ============================================================================ diff --git a/accessibility/source/extended/AccessibleGridControlHeader.cxx b/accessibility/source/extended/AccessibleGridControlHeader.cxx index c7622c18981e..1870eebc8e3e 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlHeader.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeader.cxx @@ -56,8 +56,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlHeader ) AccessibleGridControlHeader::AccessibleGridControlHeader( @@ -66,15 +64,12 @@ AccessibleGridControlHeader::AccessibleGridControlHeader( ::svt::table::AccessibleTableControlObjType eObjType): AccessibleGridControlTableBase( rxParent, rTable, eObjType ) { -// DBG_CTOR( AccessibleGridControlHeaderBar, NULL ); - DBG_ASSERT( isRowBar() || isColumnBar(), "accessibility/extended/AccessibleGridControlHeaderBar - invalid object type" ); } AccessibleGridControlHeader::~AccessibleGridControlHeader() { -// DBG_DTOR( AccessibleGridControlHeader, NULL ); } // XAccessibleContext --------------------------------------------------------- @@ -83,11 +78,11 @@ Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; + TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); if (nChildIndex<0 || nChildIndex>=getAccessibleChildCount()) - throw IndexOutOfBoundsException(); + throw IndexOutOfBoundsException(); ensureIsAlive(); Reference< XAccessible > xChild; if(m_eObjType == svt::table::TCTYPE_COLUMNHEADERBAR) @@ -106,11 +101,11 @@ AccessibleGridControlHeader::getAccessibleChild( sal_Int32 nChildIndex ) sal_Int32 SAL_CALL AccessibleGridControlHeader::getAccessibleIndexInParent() throw ( uno::RuntimeException ) { - ensureIsAlive(); - if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader()) - return 1; - else - return 0; + ensureIsAlive(); + if(m_eObjType == svt::table::TCTYPE_ROWHEADERBAR && m_aTable.HasColHeader()) + return 1; + else + return 0; } // XAccessibleComponent ------------------------------------------------------- @@ -126,8 +121,8 @@ AccessibleGridControlHeader::getAccessibleAtPoint( const awt::Point& rPoint ) sal_Int32 nRow = 0; sal_Int32 nColumnPos = 0; sal_Bool bConverted = isRowBar() ? - m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) : - m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ); + m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ) : + m_aTable.ConvertPointToCellAddress( nRow, nColumnPos, VCLPoint( rPoint ) ); return bConverted ? implGetChild( nRow, nColumnPos ) : Reference< XAccessible >(); } @@ -181,35 +176,24 @@ Reference< XAccessibleTable > SAL_CALL AccessibleGridControlHeader::getAccessibl ensureIsAlive(); return NULL; // no headers in headers } - +//not selectable Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleRows() throw ( uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - - Sequence< sal_Int32 > aSelSeq; - // row of column header bar not selectable - if( isRowBar() ) - implGetSelectedRows( aSelSeq ); + Sequence< sal_Int32 > aSelSeq(0); return aSelSeq; } //columns aren't selectable Sequence< sal_Int32 > SAL_CALL AccessibleGridControlHeader::getSelectedAccessibleColumns() throw ( uno::RuntimeException ) { - return NULL; + Sequence< sal_Int32 > aSelSeq(0); + return aSelSeq; } -//To Do - not yet implemented -sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 nRow ) +//row headers not selectable +sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleRowSelected( sal_Int32 /*nRow*/ ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidRow( nRow ); - //return isRowBar() ? implIsRowSelected( nRow ) : sal_False; return sal_False; } //columns aren't selectable @@ -219,28 +203,19 @@ sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleColumnSelected( sal_I (void)nColumn; return sal_False; } - +//not implemented Reference< XAccessible > SAL_CALL AccessibleGridControlHeader::getAccessibleCellAt( - sal_Int32 nRow, sal_Int32 nColumn ) + sal_Int32 /*nRow*/, sal_Int32 /*nColumn*/ ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidAddress( nRow, nColumn ); - return implGetChild( nRow, implToVCLColumnPos( nColumn ) ); + return NULL; } -// TO DO - not implemented yet +// not selectable sal_Bool SAL_CALL AccessibleGridControlHeader::isAccessibleSelected( - sal_Int32 nRow, sal_Int32 nColumn ) + sal_Int32 /*nRow*/, sal_Int32 /*nColumn */) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidAddress( nRow, nColumn ); - return FALSE; - // return isRowBar() ? implIsRowSelected( nRow ) : implIsColumnSelected( nColumn ); + return sal_False; } // XServiceInfo --------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx index 485c57c40ae1..485c57c40ae1 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlHeaderCell.cxx diff --git a/accessibility/source/extended/AccessibleGridControlTable.cxx b/accessibility/source/extended/AccessibleGridControlTable.cxx index efd78fc8634a..461e776f1392 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlTable.cxx +++ b/accessibility/source/extended/AccessibleGridControlTable.cxx @@ -51,8 +51,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlTable ) AccessibleGridControlTable::AccessibleGridControlTable( @@ -61,12 +59,10 @@ AccessibleGridControlTable::AccessibleGridControlTable( AccessibleTableControlObjType _eType) : AccessibleGridControlTableBase( rxParent, rTable, _eType ) { - DBG_CTOR( AccessibleGridControlTable, NULL ); } AccessibleGridControlTable::~AccessibleGridControlTable() { - DBG_DTOR( AccessibleGridControlTable, NULL ); } // XAccessibleContext --------------------------------------------------------- @@ -92,7 +88,6 @@ sal_Int32 SAL_CALL AccessibleGridControlTable::getAccessibleIndexInParent() return 1; else return 2; - } // XAccessibleComponent ------------------------------------------------------- @@ -177,7 +172,6 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - Sequence< sal_Int32 > aSelSeq; implGetSelectedRows( aSelSeq ); return aSelSeq; @@ -187,38 +181,34 @@ Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessible Sequence< sal_Int32 > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleColumns() throw ( uno::RuntimeException ) { -// TCSolarGuard aSolarGuard; -// ::osl::MutexGuard aGuard( getOslMutex() ); -// ensureIsAlive(); -// -// Sequence< sal_Int32 > aSelSeq; -// implGetSelectedColumns( aSelSeq ); -// return aSelSeq; - return NULL; + Sequence< sal_Int32 > aSelSeq(0); + return aSelSeq; } -//To Do: not implemented yet sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleRowSelected( sal_Int32 nRow ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - //TCSolarGuard aSolarGuard; - //::osl::MutexGuard aGuard( getOslMutex() ); - //ensureIsAlive(); - //ensureIsValidRow( nRow ); - //return implIsRowSelected( nRow ); - (void) nRow; - return sal_False; + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidRow( nRow ); + sal_Bool bSelected = sal_False; + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + for(int i=0; i<selectedRows.getLength(); i++) + { + if(nRow == selectedRows[i]) + { + bSelected = sal_True; + continue; + } + } + return bSelected; } //columns aren't selectable sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleColumnSelected( sal_Int32 nColumn ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - /*TCSolarGuard aSolarGuard; - ::osl::MutexGuard aGuard( getOslMutex() ); - ensureIsAlive(); - ensureIsValidColumn( nColumn ); - return implIsColumnSelected( nColumn );*/ (void) nColumn; return sal_False; } @@ -238,16 +228,14 @@ sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleSelected( sal_Int32 nRow, sal_Int32 nColumn ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - /*TCSolarGuard aSolarGuard; + TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidAddress( nRow, nColumn ); - return implIsRowSelected( nRow ) || implIsColumnSelected( nColumn );*/ - (void) nRow; (void) nColumn; - return sal_False; + //selection of single cells not possible, so if row is selected, the cell will be selected too + return isAccessibleRowSelected(nRow); } -//To Do: not implemented yet void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { @@ -255,48 +243,51 @@ void SAL_CALL AccessibleGridControlTable::selectAccessibleChild( sal_Int32 nChil ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); ensureIsValidIndex( nChildIndex ); - //if( isRowBar() ) - // implSelectRow( nChildIndex, sal_True ); - //else - // implSelectColumn( implToVCLColumnPos( nChildIndex ), sal_True ); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + sal_Int32 nRow = (nChildIndex / nColumns); + std::vector< sal_Int32 > selectedRows = m_aTable.GetSelectedRows(); + selectedRows.push_back(nRow); } -//To Do - not implemented yet sal_Bool SAL_CALL AccessibleGridControlTable::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) { - // using interface methods - no mutex - /*return isRowBar() ? - isAccessibleRowSelected( nChildIndex ) : - isAccessibleColumnSelected( nChildIndex );*/ - (void)nChildIndex; - return FALSE; + TCSolarGuard aSolarGuard; + ::osl::MutexGuard aGuard( getOslMutex() ); + ensureIsAlive(); + ensureIsValidIndex( nChildIndex ); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + sal_Int32 nRow = (nChildIndex / nColumns); + return isAccessibleRowSelected(nRow); } -//To Do - not implemented yet void SAL_CALL AccessibleGridControlTable::clearAccessibleSelection() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); + for(unsigned int i=0;i<m_aTable.GetSelectedRows().size();i++) + m_aTable.RemoveSelectedRow((sal_Int32)i); } -//To Do - not implemented yet void SAL_CALL AccessibleGridControlTable::selectAllAccessibleChildren() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + for(int i=0;i<m_aTable.GetRowCount();i++) + selectedRows[i]=i; } -//To Do - not implemented yet sal_Int32 SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChildCount() throw ( uno::RuntimeException ) { TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - return 0; + Sequence< sal_Int32 > selectedRows = getSelectedAccessibleRows(); + sal_Int32 nColumns = m_aTable.GetColumnCount(); + return selectedRows.getLength()*nColumns; } -//To Do - not implemented yet Reference< XAccessible > SAL_CALL AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) @@ -304,10 +295,12 @@ AccessibleGridControlTable::getSelectedAccessibleChild( sal_Int32 nSelectedChild TCSolarGuard aSolarGuard; ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); - (void)nSelectedChildIndex; - return NULL; + if(isAccessibleChildSelected(nSelectedChildIndex)) + return getAccessibleChild(nSelectedChildIndex); + else + return NULL; } -//To Do - not implemented yet +//not implemented yet, because only row selection possible void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw ( lang::IndexOutOfBoundsException, uno::RuntimeException ) @@ -316,14 +309,6 @@ void SAL_CALL AccessibleGridControlTable::deselectAccessibleChild( ::osl::MutexGuard aGuard( getOslMutex() ); ensureIsAlive(); (void)nSelectedChildIndex; - // method may throw lang::IndexOutOfBoundsException - //if ( isAccessibleChildSelected(nSelectedChildIndex) ) - //{ - // if( isRowBar() ) - // implSelectRow( nSelectedChildIndex, sal_False ); - // else - // implSelectColumn( implToVCLColumnPos( nSelectedChildIndex ), sal_False ); - //} } // XInterface ----------------------------------------------------------------- @@ -364,14 +349,6 @@ Rectangle AccessibleGridControlTable::implGetBoundingBoxOnScreen() return m_aTable.calcTableRect(); } // internal helper methods ---------------------------------------------------- -//To Do - not implemented yet -//sal_Int32 AccessibleGridControlTable::implGetChildIndexFromSelectedIndex( -// sal_Int32 nSelectedChildIndex ) -// throw ( lang::IndexOutOfBoundsException ) -//{ -// (void)nSelectedChildIndex; -// return 0; -//} Reference< XAccessibleTable > AccessibleGridControlTable::implGetHeaderBar( sal_Int32 nChildIndex ) throw ( uno::RuntimeException ) diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index 8a7e3102bdf7..352e80e1a666 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -53,8 +53,6 @@ namespace accessibility { // ============================================================================ -// Ctor/Dtor/disposing -------------------------------------------------------- - DBG_NAME( AccessibleGridControlTableBase ) AccessibleGridControlTableBase::AccessibleGridControlTableBase( @@ -63,12 +61,10 @@ AccessibleGridControlTableBase::AccessibleGridControlTableBase( AccessibleTableControlObjType eObjType ) : GridControlAccessibleElement( rxParent, rTable, eObjType ) { - DBG_CTOR( AccessibleGridControlTableBase, NULL ); } AccessibleGridControlTableBase::~AccessibleGridControlTableBase() { - DBG_DTOR( AccessibleGridControlTableBase, NULL ); } // XAccessibleContext --------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleGridControlTableCell.cxx b/accessibility/source/extended/AccessibleGridControlTableCell.cxx index f511eb43cbf8..43b9400e9050 100644..100755 --- a/accessibility/source/extended/AccessibleGridControlTableCell.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableCell.cxx @@ -65,7 +65,6 @@ namespace accessibility // ============================================================================= // = AccessibleGridControlCell // ============================================================================= - //DBG_NAME( svt_AccessibleGridControlCell ) // ----------------------------------------------------------------------------- AccessibleGridControlCell::AccessibleGridControlCell( const Reference< XAccessible >& _rxParent, IAccessibleTable& _rTable, @@ -74,7 +73,6 @@ namespace accessibility ,m_nRowPos( _nRowPos ) ,m_nColPos( _nColPos ) { -// DBG_CTOR( svt_AccessibleGridControlCell, NULL ); // set accessible name here, because for that we need the position of the cell // and so the base class isn't capable of doing this ::rtl::OUString aAccName; @@ -104,8 +102,7 @@ namespace accessibility ::rtl::OUString AccessibleGridControlTableCell::implGetText() { ensureIsAlive(); - //return mpTable->GetAccessibleCellText( getRowPos(), static_cast< USHORT >( getColumnPos() ) ); - return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "test" )); + return m_aTable.GetAccessibleCellText( getRowPos(), getColumnPos() ); } ::com::sun::star::lang::Locale AccessibleGridControlTableCell::implGetLocale() @@ -166,10 +163,7 @@ namespace accessibility ::com::sun::star::awt::Rectangle aRect; if ( &m_aTable ) - { aRect = AWTRectangle( m_aTable.GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) ); - } - return aRect; } @@ -363,12 +357,12 @@ namespace accessibility //!!! don't know how to put a string into the clipboard return sal_False; } + Rectangle AccessibleGridControlTableCell::implGetBoundingBox() { return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle } // ----------------------------------------------------------------------------- - Rectangle AccessibleGridControlTableCell::implGetBoundingBoxOnScreen() { return Rectangle(Point(0,0),Point(0,0));//To Do - return headercell rectangle diff --git a/automation/source/inc/rcontrol.hxx b/automation/source/inc/rcontrol.hxx index 829dd320beb6..7313603096b4 100644 --- a/automation/source/inc/rcontrol.hxx +++ b/automation/source/inc/rcontrol.hxx @@ -305,7 +305,7 @@ #define RC_Profile ( M_SOFFICE | M_MOZILLA | 9 ) // (Popup)Menu #define RC_MenuSelect ( M_SOFFICE | M_MOZILLA | 10 ) -#define RC_SetControlType ( M_SOFFICE | 11 ) +#define RC_SetControlType ( M_SOFFICE | 11 ) // deprecated since RTTI // RemoteFileAccess #define RC_Kill ( M_SOFFICE | 12 ) #define RC_RmDir ( M_SOFFICE | 13 ) @@ -429,14 +429,14 @@ -// Konstanten die im Basic zur Verfgung stehen sollen +// Constants which are available in VCLTestTool scripts -// Verschiedene Typen von Controls fr den Befehl SetControlType -// !!!!!!!!!!! Mssen alle bei SetControlType eingetragen werden !!!!!!!!!!!! +// Different types of controls recognized via RTTI #define CONST_CTBrowseBox 100 #define CONST_CTValueSet 103 #define CONST_CTORoadmap 104 #define CONST_CTIExtensionListBox 105 +#define CONST_CTTableControl 106 #define CONST_CTUnknown 199 // Konstanten fr das ALignment des gesuchten Splitters diff --git a/automation/source/server/sta_list.cxx b/automation/source/server/sta_list.cxx index 7f346c298563..c0abcb057f8b 100644 --- a/automation/source/server/sta_list.cxx +++ b/automation/source/server/sta_list.cxx @@ -53,6 +53,7 @@ #include <svtools/valueset.hxx> #include <svtools/roadmap.hxx> #include <svtools/extensionlistbox.hxx> +#include <svtools/table/tablecontrol.hxx> #define WINDOW_ANYTYPE WINDOW_BASE @@ -999,6 +1000,8 @@ String StatementList::ClientTree(Window *pBase, int Indent) WRITEc("/RoadMap") else if ( dynamic_cast< svt::IExtensionListBox* >(pBase) ) WRITEc("/ExtensionListBox") + else if ( dynamic_cast< svt::table::TableControl* >(pBase) ) + WRITEc("/TableControl") else WRITEc("/Unknown") } diff --git a/automation/source/server/statemnt.cxx b/automation/source/server/statemnt.cxx index 68ff61bbaa0d..2d1cccd9fc51 100644 --- a/automation/source/server/statemnt.cxx +++ b/automation/source/server/statemnt.cxx @@ -82,6 +82,7 @@ #include <vcl/wintypes.hxx> #include <svtools/valueset.hxx> #include <svtools/roadmap.hxx> +#include <svtools/table/tablecontrol.hxx> #include <svl/poolitem.hxx> #include <svtools/extensionlistbox.hxx> // Hat keinen Includeschutz @@ -96,6 +97,7 @@ #include <basic/ttstrhlp.hxx> #endif #include <basic/dispdefs.hxx> +#include <basic/sbuno.hxx> #include <vos/socket.hxx> #include <svl/pickerhistory.hxx> #include <com/sun/star/util/XCancellable.hpp> @@ -128,9 +130,10 @@ using namespace com::sun::star::frame; using namespace com::sun::star::uno; -using namespace com::sun::star::util; +//using namespace com::sun::star::util; geht wegen Color nicht using namespace com::sun::star::beans; using namespace svt; +//using namespace svt::table; #ifndef SBX_VALUE_DECL_DEFINED @@ -618,7 +621,7 @@ BOOL StatementSlot::Execute() AddReferer(); if ( !aUnoUrl.Len() ) aUnoUrl = CUniString("slot:").Append( String::CreateFromInt32( nFunctionId ) ); - URL aTargetURL; + ::com::sun::star::util::URL aTargetURL; aTargetURL.Complete = aUnoUrl; Reference < XFramesSupplier > xDesktop = Reference < XFramesSupplier >( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.frame.Desktop") ), UNO_QUERY ); Reference < XFrame > xFrame; @@ -664,7 +667,7 @@ BOOL StatementSlot::Execute() ReportError( GEN_RES_STR1( S_UNO_URL_EXECUTE_FAILED_NO_FRAME, aTargetURL.Complete ) ); else { - Reference < XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY ); + Reference < ::com::sun::star::util::XURLTransformer > xTrans( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.util.URLTransformer" )), UNO_QUERY ); xTrans->parseStrict( aTargetURL ); Reference < XDispatchProvider > xProv( xFrame, UNO_QUERY ); @@ -865,6 +868,13 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst if ( bFirst ) pRet->GenReturn ( RET_WinInfo, SmartId(), (comm_ULONG)nConf | DH_MODE_DATA_VALID, UniString(), TRUE ); + if ( bFirst ) + { + if ( pBase->GetType() == WINDOW_WINDOW && pBase->GetParent() && pBase->GetParent()->GetType() == WINDOW_CONTROL && + dynamic_cast< svt::table::TableControl* > ( pBase->GetParent() ) ) + pBase = pBase->GetParent(); + } + { // Klammerung, so da der String nicht whrend der Rekursion bestehen bleibt String aName; BOOL bSkip = FALSE; @@ -958,6 +968,8 @@ void StatementCommand::WriteControlData( Window *pBase, ULONG nConf, BOOL bFirst aTypeSuffix.AppendAscii( "/RoadMap", 8 ); else if ( dynamic_cast< IExtensionListBox* >(pBase) ) aTypeSuffix.AppendAscii( "/ExtensionListBox" ); + else if ( dynamic_cast< svt::table::TableControl* >(pBase) ) + aTypeSuffix.AppendAscii( "/TableControl" ); else aTypeSuffix.AppendAscii( "/Unknown", 8 ); } @@ -3388,17 +3400,17 @@ BOOL StatementCommand::Execute() { if( (nParams & PARAM_USHORT_1) ) { - Reference < XCancellable > xPicker; + Reference < ::com::sun::star::util::XCancellable > xPicker; switch( nNr1 ) { case CONST_FilePicker: { - xPicker.set( Reference < XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) ); + xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFilePicker(), UNO_QUERY ) ); } break; case CONST_FolderPicker: { - xPicker.set( Reference < XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) ); + xPicker.set( Reference < ::com::sun::star::util::XCancellable >( svt::GetTopMostFolderPicker(), UNO_QUERY ) ); } break; default: @@ -5807,6 +5819,8 @@ BOOL StatementControl::Execute() nRealControlType = CONST_CTORoadmap; else if ( dynamic_cast< IExtensionListBox* >(pControl) ) nRealControlType = CONST_CTIExtensionListBox; + else if ( dynamic_cast< ::svt::table::TableControl* >(pControl) ) + nRealControlType = CONST_CTTableControl; else nRealControlType = CONST_CTUnknown; @@ -6148,6 +6162,163 @@ protected: } } break; + + case CONST_CTTableControl: + { + ::svt::table::TableControl *pTC = dynamic_cast< ::svt::table::TableControl* >(pControl); + switch ( nMethodId ) + { + case M_GetItemType : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + { + ::svt::table::PTableModel pModel = pTC->GetModel(); + Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; + pRet->GenReturn ( RET_Value, aUId, String( aCell.getValueTypeName() )); + } + } + break; + case M_GetItemText : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetColumnCount() ) && + ValueOK( aUId, MethodString( nMethodId ), nNr2, pTC->GetRowCount() )) + { + ::svt::table::PTableModel pModel = pTC->GetModel(); + Any aCell = pModel->getCellContent()[nNr2-1][nNr1-1]; + /* doesn't work ATM since it gets casted to SbxDATE in VCLTestTool unfortunately + SbxVariableRef xRes = new SbxVariable( SbxVARIANT ); + unoToSbxValue( xRes, aCell ); + pRet->GenReturn ( RET_Value, aUId, *xRes );*/ + + Type aType = aCell.getValueType(); + TypeClass eTypeClass = aType.getTypeClass(); + switch( eTypeClass ) + { + /*case TypeClass_ENUM: + { + sal_Int32 nEnum = 0; + enum2int( nEnum, aValue ); + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)nEnum ); + } + break;*/ + case TypeClass_BOOLEAN: + pRet->GenReturn ( RET_Value, aUId, *(sal_Bool*)aCell.getValue() ); + break; + case TypeClass_CHAR: + { + ::rtl::OUString aContent( *(sal_Unicode*)aCell.getValue() ); + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + break; + case TypeClass_STRING: + { + ::rtl::OUString aContent; + aCell >>= aContent; + pRet->GenReturn ( RET_Value, aUId, aContent ); + } + break; + //case TypeClass_FLOAT: break; + //case TypeClass_DOUBLE: break; + //case TypeClass_OCTET: break; + case TypeClass_BYTE: + case TypeClass_SHORT: + case TypeClass_LONG: + case TypeClass_HYPER: + case TypeClass_UNSIGNED_LONG: + case TypeClass_UNSIGNED_HYPER: + { + comm_ULONG val = 0; + aCell >>= val; + pRet->GenReturn ( RET_Value, aUId, val ); + } + break; + //case TypeClass_UNSIGNED_OCTET:break; + case TypeClass_UNSIGNED_SHORT: + { + comm_USHORT val = 0; + aCell >>= val; + pRet->GenReturn ( RET_Value, aUId, val ); + } + break; + default: + pRet->GenReturn ( RET_Value, aUId, comm_USHORT(0) ); + break; + } + } + } + break; + case M_GetColumnCount : + { + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetColumnCount() ); + } + break; + case M_GetRowCount : + { + pRet->GenReturn ( RET_Value, aUId, (comm_ULONG)pTC->GetRowCount() ); + } + break; + case M_Select : + { + if ( ValueOK( aUId, MethodString( nMethodId ), nNr1, pTC->GetRowCount() )) + { + if ( pTC->GoToRow( ::svt::table::RowPos( nNr1-1 ) ) ) + { + Size aSize( pTC->GetSizePixel() ); +// DirectLog( S_QAError, UniString::CreateFromInt32( aSize.Width() ).Append( UniString::CreateFromInt32( aSize.Height() ) ) ); + Point aPos( aSize.Width() / 2, aSize.Height() / 2 ); + long nStep = aSize.Height() / 4; + ::svt::table::RowPos nLastPos; + while ( ( nLastPos = pTC->GetCurrentRow( aPos ) ) != nNr1-1 && nStep > 0 ) + { + if ( nLastPos > nNr1-1 || nLastPos == ROW_INVALID ) + aPos.Y() -= nStep; + else + aPos.Y() += nStep; + nStep /= 2; + } + if ( pTC->GetCurrentRow( aPos ) == nNr1-1 ) + { + MouseEvent aMEvnt(aPos,1,MOUSE_SIMPLECLICK|MOUSE_SELECT,MOUSE_LEFT,KEY_MOD1); + pTC->getSelEngine()->SelMouseButtonDown( aMEvnt ); + pTC->getSelEngine()->SelMouseButtonUp( aMEvnt ); + } + else + ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "find pos" ) ); + } + else + ReportError( aUId, GEN_RES_STR2c2( S_METHOD_FAILED, MethodString( nMethodId ), "GoTo" ) ); + } + } + break; + case M_GetSelCount : + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows().size() )); + break; + case M_GetSelIndex : + if ( ! (nParams & PARAM_USHORT_1) ) + nNr1 = 1; + if ( ValueOK( aUId, CUniString("GetSelIndex"), nNr1, pTC->GetSelectedRows().size() ) ) + pRet->GenReturn ( RET_Value, aUId, comm_USHORT( pTC->GetSelectedRows()[nNr1-1] +1 ) ); + break; +/* case M_GetSelText : + if ( ! (nParams & PARAM_USHORT_1) ) + nNr1 = 1; + if ( ValueOK(aUId, CUniString("GetSelText"),nNr1,((SvLBox*)pControl)->GetSelectionCount()) ) + { + nNr1--; + COUNT_LBOX( FirstSelected, NextSelected, nNr1); + GetFirstValidTextItem( pThisEntry ); + pRet->GenReturn ( RET_Value, aUId, pItem->GetText() ); + } + break; + */ + default: + ReportError( aUId, GEN_RES_STR2c2( S_UNKNOWN_METHOD, MethodString(nMethodId), "TableControl" ) ); + break; + } + } + break; + case CONST_CTUnknown: ReportError( aUId, GEN_RES_STR2( S_UNKNOWN_TYPE, UniString::CreateFromInt32( nRT ), MethodString(nMethodId) ) ); break; diff --git a/automation/source/testtool/objtest.cxx b/automation/source/testtool/objtest.cxx index 461dff80b13d..2361361f277f 100644 --- a/automation/source/testtool/objtest.cxx +++ b/automation/source/testtool/objtest.cxx @@ -518,6 +518,8 @@ void TestToolObj::LoadIniFile() // Laden der IniEinstellungen, die d abGP.Append( "21" ); // Linux S390 #elif defined LINUX && defined HPPA abGP.Append( "22" ); // Linux PA-RISC +#elif defined LINUX && defined AXP + abGP.Append( "23" ); // Linux ALPHA #else #error ("unknown platform. please request an ID for your platform on qa/dev") #endif diff --git a/basctl/inc/basidesh.hrc b/basctl/inc/basidesh.hrc index 51d1ed2be6fc..8bf7d3316cd0 100644 --- a/basctl/inc/basidesh.hrc +++ b/basctl/inc/basidesh.hrc @@ -182,6 +182,10 @@ #define RID_STR_DLGIMP_MISMATCH_OMIT ( RID_BASICIDE_START + 115 ) #define RID_STR_DLGIMP_MISMATCH_TITLE ( RID_BASICIDE_START + 116 ) #define RID_STR_DLGIMP_MISMATCH_TEXT ( RID_BASICIDE_START + 117 ) +#define RID_STR_DOCUMENT_OBJECTS ( RID_BASICIDE_START + 118 ) +#define RID_STR_USERFORMS ( RID_BASICIDE_START + 119 ) +#define RID_STR_NORMAL_MODULES ( RID_BASICIDE_START + 120 ) +#define RID_STR_CLASS_MODULES ( RID_BASICIDE_START + 121 ) #endif // _SVX_NOIDERESIDS diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index 9fc700948249..9f97e1766c3b 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -46,6 +46,7 @@ #include <com/sun/star/script/XLibraryContainer2.hpp> #endif #include <com/sun/star/document/MacroExecMode.hpp> +#include <com/sun/star/script/ModuleType.hpp> #include <toolkit/helper/vclunohelper.hxx> #include <sfx2/docfile.hxx> #include <basic/basrdll.hxx> @@ -202,21 +203,35 @@ ModulWindow::ModulWindow( ModulWindowLayout* pParent, const ScriptDocument& rDoc pLayout = pParent; aXEditorWindow.Show(); - BasicManager* pBasMgr = rDocument.getBasicManager(); - if ( pBasMgr ) + SetBackground(); +} + +SbModuleRef ModulWindow::XModule() +{ + // ModuleWindows can now be created as a result of the + // modules getting created via the api. This is a result of an + // elementInserted event from the BasicLibrary container. + // However the SbModule is also created from a different listener to + // the same event ( in basmgr ) Therefore it is possible when we look + // for xModule it may not yet be available, here we keep tring to access + // the module until such time as it exists + + if ( !xModule.Is() ) { - StarBASIC* pBasic = pBasMgr->GetLib( aLibName ); - if ( pBasic ) + BasicManager* pBasMgr = GetDocument().getBasicManager(); + if ( pBasMgr ) { - xBasic = pBasic; - xModule = (SbModule*)pBasic->FindModule( aName ); + StarBASIC* pBasic = pBasMgr->GetLib( GetLibName() ); + if ( pBasic ) + { + xBasic = pBasic; + xModule = (SbModule*)pBasic->FindModule( GetName() ); + } } } - - SetBackground(); + return xModule; } - __EXPORT ModulWindow::~ModulWindow() { DBG_DTOR( ModulWindow, 0 ); @@ -266,7 +281,7 @@ void ModulWindow::CheckCompileBasic() { DBG_CHKTHIS( ModulWindow, 0 ); - if ( xModule.Is() ) + if ( XModule().Is() ) { // Zur Laufzeit wird niemals compiliert! BOOL bRunning = StarBASIC::IsRunning(); @@ -322,7 +337,7 @@ BOOL ModulWindow::BasicExecute() CheckCompileBasic(); - if ( xModule.Is() && xModule->IsCompiled() && !aStatus.bError ) + if ( XModule().Is() && xModule->IsCompiled() && !aStatus.bError ) { if ( GetBreakPoints().Count() ) aStatus.nBasicFlags = aStatus.nBasicFlags | SbDEBUG_BREAK; @@ -332,6 +347,9 @@ BOOL ModulWindow::BasicExecute() DBG_ASSERT( xModule.Is(), "Kein Modul!" ); AddStatus( BASWIN_RUNNINGBASIC ); USHORT nStart, nEnd, nCurMethodStart = 0; + TextSelection aSel = GetEditView()->GetSelection(); + if ( aDocument.isInVBAMode() ) + nCurMethodStart = ( aSel.GetStart().GetPara() + 1 ); SbMethod* pMethod = 0; // erstes Macro, sonst blind "Main" (ExtSearch?) for ( USHORT nMacro = 0; nMacro < xModule->GetMethods()->Count(); nMacro++ ) @@ -339,15 +357,27 @@ BOOL ModulWindow::BasicExecute() SbMethod* pM = (SbMethod*)xModule->GetMethods()->Get( nMacro ); DBG_ASSERT( pM, "Method?" ); pM->GetLineRange( nStart, nEnd ); - if ( !pMethod || ( nStart < nCurMethodStart ) ) + if ( aDocument.isInVBAMode() ) + { + if ( nCurMethodStart >= nStart && nCurMethodStart <= nEnd ) + { + pMethod = pM; + break; + } + } + else if ( !pMethod || ( nStart < nCurMethodStart ) ) { pMethod = pM; nCurMethodStart = nStart; } } if ( !pMethod ) - pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD ); - + { + if ( aDocument.isInVBAMode() ) + return ( BasicIDE::ChooseMacro( uno::Reference< frame::XModel >(), FALSE, rtl::OUString() ).getLength() > 0 ) ? TRUE : FALSE; + else + pMethod = (SbMethod*)xModule->Find( String( RTL_CONSTASCII_USTRINGPARAM( "Main" ) ), SbxCLASS_METHOD ); + } if ( pMethod ) { pMethod->SetDebugFlags( aStatus.nBasicFlags ); @@ -374,7 +404,7 @@ BOOL ModulWindow::CompileBasic() CheckCompileBasic(); BOOL bIsCompiled = FALSE; - if ( xModule.Is() ) + if ( XModule().Is() ) bIsCompiled = xModule->IsCompiled(); return bIsCompiled; @@ -551,11 +581,11 @@ BOOL ModulWindow::ImportDialog() BOOL ModulWindow::ToggleBreakPoint( ULONG nLine ) { - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); BOOL bNewBreakPoint = FALSE; - if ( xModule.Is() ) + if ( XModule().Is() ) { CheckCompileBasic(); if ( aStatus.bError ) @@ -597,9 +627,9 @@ BOOL ModulWindow::ToggleBreakPoint( ULONG nLine ) void ModulWindow::UpdateBreakPoint( const BreakPoint& rBrk ) { - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); - if ( xModule.Is() ) + if ( XModule().Is() ) { CheckCompileBasic(); @@ -823,9 +853,9 @@ void ModulWindow::BasicRemoveWatch() void ModulWindow::EditMacro( const String& rMacroName ) { DBG_CHKTHIS( ModulWindow, 0 ); - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); - if ( xModule.Is() ) + if ( XModule().Is() ) { CheckCompileBasic(); @@ -895,12 +925,12 @@ BOOL __EXPORT ModulWindow::AllowUndo() void __EXPORT ModulWindow::UpdateData() { DBG_CHKTHIS( ModulWindow, 0 ); - DBG_ASSERT( xModule.Is(), "Kein Modul!" ); + DBG_ASSERT( XModule().Is(), "Kein Modul!" ); // UpdateData wird gerufen, wenn sich der Source von aussen // geaendert hat. // => Keine Unterbrechungen erwuenscht! - if ( xModule.Is() ) + if ( XModule().Is() ) { SetModule( xModule->GetSource32() ); @@ -1193,19 +1223,6 @@ void __EXPORT ModulWindow::DoScroll( ScrollBar* pCurScrollBar ) } -BOOL ModulWindow::RenameModule( const String& rNewName ) -{ - if ( !BasicIDE::RenameModule( this, GetDocument(), GetLibName(), GetName(), rNewName ) ) - return FALSE; - - SfxBindings* pBindings = BasicIDE::GetBindingsPtr(); - if ( pBindings ) - pBindings->Invalidate( SID_DOC_MODIFIED ); - - return TRUE; -} - - BOOL __EXPORT ModulWindow::IsModified() { return GetEditEngine() ? GetEditEngine()->IsModified() : FALSE; @@ -1221,7 +1238,7 @@ void __EXPORT ModulWindow::GoOnTop() String ModulWindow::GetSbModuleName() { String aModuleName; - if ( xModule.Is() ) + if ( XModule().Is() ) aModuleName = xModule->GetName(); return aModuleName; } @@ -1343,7 +1360,7 @@ USHORT __EXPORT ModulWindow::GetSearchOptions() void __EXPORT ModulWindow::BasicStarted() { - if ( xModule.Is() ) + if ( XModule().Is() ) { aStatus.bIsRunning = TRUE; BreakPointList& rList = GetBreakPoints(); @@ -1372,7 +1389,39 @@ BasicEntryDescriptor ModulWindow::CreateEntryDescriptor() ScriptDocument aDocument( GetDocument() ); String aLibName( GetLibName() ); LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName ); - return BasicEntryDescriptor( aDocument, eLocation, aLibName, GetName(), OBJ_TYPE_MODULE ); + String aModName( GetName() ); + String aLibSubName; + if( xBasic.Is() && aDocument.isInVBAMode() && XModule().Is() ) + { + switch( xModule->GetModuleType() ) + { + case script::ModuleType::DOCUMENT: + { + aLibSubName = String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ); + uno::Reference< container::XNameContainer > xLib = aDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ); + if( xLib.is() ) + { + String sObjName; + ModuleInfoHelper::getObjectName( xLib, aModName, sObjName ); + if( sObjName.Len() ) + { + aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")"); + } + } + break; + } + case script::ModuleType::FORM: + aLibSubName = String( IDEResId( RID_STR_USERFORMS ) ); + break; + case script::ModuleType::NORMAL: + aLibSubName = String( IDEResId( RID_STR_NORMAL_MODULES ) ); + break; + case script::ModuleType::CLASS: + aLibSubName = String( IDEResId( RID_STR_CLASS_MODULES ) ); + break; + } + } + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aModName, OBJ_TYPE_MODULE ); } void ModulWindow::SetReadOnly( BOOL b ) diff --git a/basctl/source/basicide/baside2.hxx b/basctl/source/basicide/baside2.hxx index 6d35f0a027a8..280bb6ee3ab6 100644 --- a/basctl/source/basicide/baside2.hxx +++ b/basctl/source/basicide/baside2.hxx @@ -357,6 +357,7 @@ private: void AssertValidEditEngine(); sal_Int32 FormatAndPrint( Printer* pPrinter, sal_Int32 nPage = -1 ); + SbModuleRef XModule(); protected: virtual void Resize(); virtual void GetFocus(); @@ -389,7 +390,7 @@ public: virtual void SetReadOnly( BOOL bReadOnly ); virtual BOOL IsReadOnly(); - StarBASIC* GetBasic() { return xBasic; } + StarBASIC* GetBasic() { XModule(); return xBasic; } SbModule* GetSbModule() { return xModule; } void SetSbModule( SbModule* pModule ) { xModule = pModule; } @@ -417,7 +418,6 @@ public: // void InsertFromObjectCatalog( ObjectCatalog* pObjDlg ); BOOL ToggleBreakPoint( ULONG nLine ); - BOOL RenameModule( const String& rNewName ); BasicStatus& GetBasicStatus() { return aStatus; } diff --git a/basctl/source/basicide/baside3.cxx b/basctl/source/basicide/baside3.cxx index afbe3daf5be1..f4a3c1d48fc7 100644 --- a/basctl/source/basicide/baside3.cxx +++ b/basctl/source/basicide/baside3.cxx @@ -1297,8 +1297,9 @@ BasicEntryDescriptor DialogWindow::CreateEntryDescriptor() { ScriptDocument aDocument( GetDocument() ); String aLibName( GetLibName() ); + String aLibSubName; LibraryLocation eLocation = aDocument.getLibraryLocation( aLibName ); - return BasicEntryDescriptor( aDocument, eLocation, aLibName, GetName(), OBJ_TYPE_DIALOG ); + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, GetName(), OBJ_TYPE_DIALOG ); } void DialogWindow::SetReadOnly( BOOL b ) diff --git a/basctl/source/basicide/basides1.cxx b/basctl/source/basicide/basides1.cxx index 4432de9aa282..351186325b09 100644 --- a/basctl/source/basicide/basides1.cxx +++ b/basctl/source/basicide/basides1.cxx @@ -109,7 +109,6 @@ void __EXPORT BasicIDEShell::ExecuteCurrent( SfxRequest& rReq ) { if ( aDocument.removeModule( aLibName, aName ) ) { - RemoveWindow( pCurWin, TRUE ); BasicIDE::MarkDocumentModified( aDocument ); } } @@ -430,11 +429,31 @@ void __EXPORT BasicIDEShell::ExecuteGlobal( SfxRequest& rReq ) { String aNewName( rModName.GetValue() ); String aOldName( pWin->GetName() ); - if ( aNewName != aOldName ) { - if ( ( pWin->IsA( TYPE( ModulWindow ) ) && ((ModulWindow*)pWin)->RenameModule( aNewName ) ) - || ( pWin->IsA( TYPE( DialogWindow ) ) && ((DialogWindow*)pWin)->RenameDialog( aNewName ) ) ) + bool bRenameOk = false; + if ( pWin->IsA( TYPE( ModulWindow ) ) ) + { + ModulWindow* pModWin = (ModulWindow*)pWin; + String aLibName = ( pModWin->GetLibName() ); + ScriptDocument aDocument( pWin->GetDocument() ); + + if ( BasicIDE::RenameModule( pModWin, aDocument, aLibName, aOldName, aNewName ) ) + { + bRenameOk = true; + // Because we listen for container events for script + // modules, rename will delete the 'old' window + // pWin has been invalidated, restore now + pWin = FindBasWin( aDocument, aLibName, aNewName, TRUE ); + } + + } + else if ( pWin->IsA( TYPE( DialogWindow ) ) ) + { + DialogWindow* pDlgWin = (DialogWindow*)pWin; + bRenameOk = pDlgWin->RenameDialog( aNewName ); + } + if ( bRenameOk ) { BasicIDE::MarkDocumentModified( pWin->GetDocument() ); } diff --git a/basctl/source/basicide/basides2.cxx b/basctl/source/basicide/basides2.cxx index 20de8e9aafba..bef969db9266 100644 --- a/basctl/source/basicide/basides2.cxx +++ b/basctl/source/basicide/basides2.cxx @@ -51,6 +51,10 @@ #include <tools/diagnose_ex.h> #include <sfx2/sfxdefs.hxx> #include <sfx2/signaturestate.hxx> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XNamed.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> using namespace ::com::sun::star; using namespace ::com::sun::star::uno; @@ -235,7 +239,7 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const if ( !aLibName.Len() ) aLibName = String::CreateFromAscii( "Standard" ); - rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ); + uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, aLibName ); if ( !aModName.Len() ) aModName = rDocument.createObjectName( E_SCRIPTS, aLibName ); @@ -254,9 +258,15 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const if ( bSuccess ) { - // new module window - pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule ); - nKey = InsertWindowInTable( pWin ); + pWin = FindBasWin( rDocument, aLibName, aModName, FALSE, TRUE ); + if( !pWin ) + { + // new module window + pWin = new ModulWindow( pModulLayout, rDocument, aLibName, aModName, aModule ); + nKey = InsertWindowInTable( pWin ); + } + else // we've gotten called recursively ( via listener from createModule above ), get outta here + return pWin; } } else @@ -271,6 +281,17 @@ ModulWindow* BasicIDEShell::CreateBasWin( const ScriptDocument& rDocument, const } DBG_ASSERT( nKey, "CreateBasWin: Kein Key- Fenster nicht gefunden!" ); } + if( nKey && xLib.is() && rDocument.isInVBAMode() ) + { + // display a nice friendly name in the ObjectModule tab, + // combining the objectname and module name, e.g. Sheet1 ( Financials ) + String sObjName; + ModuleInfoHelper::getObjectName( xLib, rModName, sObjName ); + if( sObjName.Len() ) + { + aModName.AppendAscii(" (").Append(sObjName).AppendAscii(")"); + } + } pTabBar->InsertPage( (USHORT)nKey, aModName ); pTabBar->Sort(); pWin->GrabScrollBars( &aHScrollBar, &aVScrollBar ); diff --git a/basctl/source/basicide/basidesh.cxx b/basctl/source/basicide/basidesh.cxx index 23978f4df10b..2f9303756e09 100644 --- a/basctl/source/basicide/basidesh.cxx +++ b/basctl/source/basicide/basidesh.cxx @@ -77,6 +77,9 @@ #include <com/sun/star/script/XLibraryContainer.hpp> #include <com/sun/star/script/XLibraryContainerPassword.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/container/XContainerListener.hpp> +#include <com/sun/star/script/XLibraryContainer.hpp> #include <svx/xmlsecctrl.hxx> @@ -84,6 +87,71 @@ using namespace ::com::sun::star::uno; using namespace ::com::sun::star; using ::rtl::OUString; +static const rtl::OUString sStandardLibName( rtl::OUString::createFromAscii("Standard") ); + +typedef ::cppu::WeakImplHelper1< container::XContainerListener > ContainerListenerBASE; + +class ContainerListenerImpl : public ContainerListenerBASE +{ + BasicIDEShell* mpShell; +public: + + ContainerListenerImpl( BasicIDEShell* pShell ) : mpShell( pShell ) {} + + ~ContainerListenerImpl() + { + } + + void addContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName ) + { + try + { + uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, FALSE ), uno::UNO_QUERY ); + if ( xContainer.is() ) + { + uno::Reference< container::XContainerListener > xContainerListener( this ); + xContainer->addContainerListener( xContainerListener ); + } + } + catch( uno::Exception& ) {} + } + void removeContainerListener( const ScriptDocument& rScriptDocument, const String& aLibName ) + { + try + { + uno::Reference< container::XContainer > xContainer( rScriptDocument.getLibrary( E_SCRIPTS, aLibName, FALSE ), uno::UNO_QUERY ); + if ( xContainer.is() ) + { + uno::Reference< container::XContainerListener > xContainerListener( this ); + xContainer->removeContainerListener( xContainerListener ); + } + } + catch( uno::Exception& ) {} + } + + // XEventListener + virtual void SAL_CALL disposing( const lang::EventObject& ) throw( uno::RuntimeException ) {} + + // XContainerListener + virtual void SAL_CALL elementInserted( const container::ContainerEvent& Event ) throw( uno::RuntimeException ) + { + rtl::OUString sModuleName; + if( mpShell && ( Event.Accessor >>= sModuleName ) ) + mpShell->FindBasWin( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, TRUE, FALSE ); + } + virtual void SAL_CALL elementReplaced( const container::ContainerEvent& ) throw( com::sun::star::uno::RuntimeException ) { } + virtual void SAL_CALL elementRemoved( const container::ContainerEvent& Event ) throw( com::sun::star::uno::RuntimeException ) + { + rtl::OUString sModuleName; + if( mpShell && ( Event.Accessor >>= sModuleName ) ) + { + IDEBaseWindow* pWin = mpShell->FindWindow( mpShell->m_aCurDocument, mpShell->m_aCurLibName, sModuleName, BASICIDE_TYPE_MODULE, TRUE ); + if( pWin ) + mpShell->RemoveWindow( pWin, TRUE, TRUE ); + } + } + +}; TYPEINIT1( BasicIDEShell, SfxViewShell ); @@ -121,6 +189,7 @@ BasicIDEShell::BasicIDEShell( SfxViewFrame* pFrame_, SfxViewShell* /* pOldShell m_bAppBasicModified( FALSE ), m_aNotifier( *this ) { + m_xLibListener = new ContainerListenerImpl( this ); Init(); GnBasicIDEShellCount++; } @@ -212,6 +281,12 @@ __EXPORT BasicIDEShell::~BasicIDEShell() delete pTabBar; delete pObjectCatalog; DestroyModulWindowLayout(); + + ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() ); + // Destroy all ContainerListeners for Basic Container. + if ( pListener ) + pListener->removeContainerListener( m_aCurDocument, m_aCurLibName ); + // MI: Das gab einen GPF im SDT beim Schliessen da dann der ViewFrame die // ObjSh loslaesst. Es wusste auch keiner mehr wozu das gut war. // GetViewFrame()->GetObjectShell()->Broadcast( SfxSimpleHint( SFX_HINT_DYING ) ); @@ -828,9 +903,22 @@ void BasicIDEShell::RemoveWindow( IDEBaseWindow* pWindow_, BOOL bDestroy, BOOL b { pWindow_->AddStatus( BASWIN_TOBEKILLED ); pWindow_->Hide(); - StarBASIC::Stop(); - // Es kommt kein Notify... - pWindow_->BasicStopped(); + // In normal mode stop basic in windows to be deleted + // In VBA stop basic only if the running script is trying to delete + // its parent module + bool bStop = true; + if ( pWindow_->GetDocument().isInVBAMode() ) + { + SbModule* pMod = StarBASIC::GetActiveModule(); + if ( !pMod || ( pMod && ( pMod->GetName() != pWindow_->GetName() ) ) ) + bStop = false; + } + if ( bStop ) + { + StarBASIC::Stop(); + // Es kommt kein Notify... + pWindow_->BasicStopped(); + } aIDEWindowTable.Insert( nKey, pWindow_ ); // wieder einhaegen } } @@ -918,8 +1006,17 @@ void BasicIDEShell::SetCurLib( const ScriptDocument& rDocument, String aLibName, { if ( !bCheck || ( rDocument != m_aCurDocument || aLibName != m_aCurLibName ) ) { + ContainerListenerImpl* pListener = static_cast< ContainerListenerImpl* >( m_xLibListener.get() ); + + if ( pListener ) + pListener->removeContainerListener( m_aCurDocument, m_aCurLibName ); + m_aCurDocument = rDocument; + + pListener->addContainerListener( m_aCurDocument, aLibName ); + m_aCurLibName = aLibName; + if ( bUpdateWindows ) UpdateWindows(); diff --git a/basctl/source/basicide/basidesh.src b/basctl/source/basicide/basidesh.src index f0c0727cd22f..556211f690af 100644 --- a/basctl/source/basicide/basidesh.src +++ b/basctl/source/basicide/basidesh.src @@ -636,6 +636,22 @@ String RID_STR_TRANSLATION_DEFAULT { Text [ en-US ] = "[Default Language]" ; }; +String RID_STR_DOCUMENT_OBJECTS +{ + Text [ en-US ] = "Document Objects" ; +}; +String RID_STR_USERFORMS +{ + Text [ en-US ] = "Forms" ; +}; +String RID_STR_NORMAL_MODULES +{ + Text [ en-US ] = "Modules" ; +}; +String RID_STR_CLASS_MODULES +{ + Text [ en-US ] = "Class Modules" ; +}; String RID_STR_DLGIMP_CLASH_RENAME diff --git a/basctl/source/basicide/basobj2.cxx b/basctl/source/basicide/basobj2.cxx index d2672f39928f..3604866b4202 100644 --- a/basctl/source/basicide/basobj2.cxx +++ b/basctl/source/basicide/basobj2.cxx @@ -191,7 +191,7 @@ bool RenameModule( Window* pErrorParent, const ScriptDocument& rDocument, const BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); if ( pIDEShell ) { - IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rOldName, BASICIDE_TYPE_MODULE, FALSE ); + IDEBaseWindow* pWin = pIDEShell->FindWindow( rDocument, rLibName, rNewName, BASICIDE_TYPE_MODULE, TRUE ); if ( pWin ) { // set new name in window diff --git a/basctl/source/basicide/bastype2.cxx b/basctl/source/basicide/bastype2.cxx index a37eb752e2ea..0709fe38cbe2 100644 --- a/basctl/source/basicide/bastype2.cxx +++ b/basctl/source/basicide/bastype2.cxx @@ -50,10 +50,51 @@ #include <com/sun/star/frame/XModuleManager.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/componentcontext.hxx> +#include <map> +#include <com/sun/star/script/ModuleType.hpp> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/container/XNamed.hpp> using namespace ::com::sun::star::uno; using namespace ::com::sun::star; +void ModuleInfoHelper::getObjectName( const uno::Reference< container::XNameContainer >& rLib, const String& rModName, String& rObjName ) +{ + try + { + uno::Reference< script::XVBAModuleInfo > xVBAModuleInfo( rLib, uno::UNO_QUERY ); + if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( rModName ) ) + { + script::ModuleInfo aModuleInfo = xVBAModuleInfo->getModuleInfo( rModName ); + uno::Any aObject( aModuleInfo.ModuleObject ); + uno::Reference< lang::XServiceInfo > xServiceInfo( aObject, uno::UNO_QUERY ); + if( xServiceInfo.is() && xServiceInfo->supportsService( rtl::OUString::createFromAscii( "ooo.vba.excel.Worksheet" ) ) ) + { + uno::Reference< container::XNamed > xNamed( aObject, uno::UNO_QUERY ); + if( xNamed.is() ) + rObjName = xNamed->getName(); + } + } + } + catch( uno::Exception& ) + { + } +} + +sal_Int32 ModuleInfoHelper::getModuleType( const uno::Reference< container::XNameContainer >& rLib, const String& rModName ) +{ + sal_Int32 nType = com::sun::star::script::ModuleType::NORMAL; + uno::Reference< script::XVBAModuleInfo > xVBAModuleInfo( rLib, uno::UNO_QUERY ); + if ( xVBAModuleInfo.is() && xVBAModuleInfo->hasModuleInfo( rModName ) ) + { + script::ModuleInfo aModuleInfo = xVBAModuleInfo->getModuleInfo( rModName ); + nType = aModuleInfo.ModuleType; + } + return nType; +} BasicEntry::~BasicEntry() { @@ -88,20 +129,22 @@ BasicEntryDescriptor::BasicEntryDescriptor() { } -BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, BasicEntryType eType ) +BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, BasicEntryType eType ) :m_aDocument( rDocument ) ,m_eLocation( eLocation ) ,m_aLibName( rLibName ) + ,m_aLibSubName( rLibSubName ) ,m_aName( rName ) ,m_eType( eType ) { OSL_ENSURE( m_aDocument.isValid(), "BasicEntryDescriptor::BasicEntryDescriptor: invalid document!" ); } -BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, const String& rMethodName, BasicEntryType eType ) +BasicEntryDescriptor::BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, const String& rMethodName, BasicEntryType eType ) :m_aDocument( rDocument ) ,m_eLocation( eLocation ) ,m_aLibName( rLibName ) + ,m_aLibSubName( rLibSubName ) ,m_aName( rName ) ,m_aMethodName( rMethodName ) ,m_eType( eType ) @@ -117,6 +160,7 @@ BasicEntryDescriptor::BasicEntryDescriptor( const BasicEntryDescriptor& rDesc ) :m_aDocument( rDesc.m_aDocument ) ,m_eLocation( rDesc.m_eLocation ) ,m_aLibName( rDesc.m_aLibName ) + ,m_aLibSubName( rDesc.m_aLibSubName ) ,m_aName( rDesc.m_aName ) ,m_aMethodName( rDesc.m_aMethodName ) ,m_eType( rDesc.m_eType ) @@ -128,6 +172,7 @@ BasicEntryDescriptor& BasicEntryDescriptor::operator=( const BasicEntryDescripto m_aDocument = rDesc.m_aDocument; m_eLocation = rDesc.m_eLocation; m_aLibName = rDesc.m_aLibName; + m_aLibSubName = rDesc.m_aLibSubName; m_aName = rDesc.m_aName; m_aMethodName = rDesc.m_aMethodName; m_eType = rDesc.m_eType; @@ -140,6 +185,7 @@ bool BasicEntryDescriptor::operator==( const BasicEntryDescriptor& rDesc ) const return m_aDocument == rDesc.m_aDocument && m_eLocation == rDesc.m_eLocation && m_aLibName == rDesc.m_aLibName && + m_aLibSubName == rDesc.m_aLibSubName && m_aName == rDesc.m_aName && m_aMethodName == rDesc.m_aMethodName && m_eType == rDesc.m_eType; @@ -284,41 +330,46 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const { try { - // get a sorted list of module names - Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName ); - sal_Int32 nModCount = aModNames.getLength(); - const ::rtl::OUString* pModNames = aModNames.getConstArray(); - - for ( sal_Int32 i = 0 ; i < nModCount ; i++ ) + if( rDocument.isInVBAMode() ) + ImpCreateLibSubEntriesInVBAMode( pLibRootEntry, rDocument, rLibName ); + else { - String aModName = pModNames[ i ]; - SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE ); - if ( !pModuleEntry ) - pModuleEntry = AddEntry( - aModName, - Image( IDEResId( RID_IMG_MODULE ) ), - Image( IDEResId( RID_IMG_MODULE_HC ) ), - pLibRootEntry, false, - std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); + // get a sorted list of module names + Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName ); + sal_Int32 nModCount = aModNames.getLength(); + const ::rtl::OUString* pModNames = aModNames.getConstArray(); - // methods - if ( nMode & BROWSEMODE_SUBS ) + for ( sal_Int32 i = 0 ; i < nModCount ; i++ ) { - Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName ); - sal_Int32 nCount = aNames.getLength(); - const ::rtl::OUString* pNames = aNames.getConstArray(); - - for ( sal_Int32 j = 0 ; j < nCount ; j++ ) + String aModName = pModNames[ i ]; + SvLBoxEntry* pModuleEntry = FindEntry( pLibRootEntry, aModName, OBJ_TYPE_MODULE ); + if ( !pModuleEntry ) + pModuleEntry = AddEntry( + aModName, + Image( IDEResId( RID_IMG_MODULE ) ), + Image( IDEResId( RID_IMG_MODULE_HC ) ), + pLibRootEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); + + // methods + if ( nMode & BROWSEMODE_SUBS ) { - String aName = pNames[ j ]; - SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); - if ( !pEntry ) - pEntry = AddEntry( - aName, - Image( IDEResId( RID_IMG_MACRO ) ), - Image( IDEResId( RID_IMG_MACRO_HC ) ), - pModuleEntry, false, - std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) ); + Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName ); + sal_Int32 nCount = aNames.getLength(); + const ::rtl::OUString* pNames = aNames.getConstArray(); + + for ( sal_Int32 j = 0 ; j < nCount ; j++ ) + { + String aName = pNames[ j ]; + SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); + if ( !pEntry ) + pEntry = AddEntry( + aName, + Image( IDEResId( RID_IMG_MACRO ) ), + Image( IDEResId( RID_IMG_MACRO_HC ) ), + pModuleEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) ); + } } } } @@ -365,6 +416,140 @@ void BasicTreeListBox::ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const } } +void BasicTreeListBox::ImpCreateLibSubEntriesInVBAMode( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName ) +{ + + ::std::vector< std::pair< BasicEntryType, ::rtl::OUString > > aEntries; + aEntries.push_back( ::std::make_pair( OBJ_TYPE_DOCUMENT_OBJECTS, String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ); + aEntries.push_back( ::std::make_pair( OBJ_TYPE_USERFORMS, String( IDEResId( RID_STR_USERFORMS ) ) ) ); + aEntries.push_back( ::std::make_pair( OBJ_TYPE_NORMAL_MODULES, String( IDEResId( RID_STR_NORMAL_MODULES ) ) ) ); + aEntries.push_back( ::std::make_pair( OBJ_TYPE_CLASS_MODULES, String( IDEResId( RID_STR_CLASS_MODULES ) ) ) ); + + ::std::vector< std::pair< BasicEntryType, ::rtl::OUString > >::iterator iter; + for( iter = aEntries.begin(); iter != aEntries.end(); ++iter ) + { + BasicEntryType eType = iter->first; + ::rtl::OUString aEntryName = iter->second; + SvLBoxEntry* pLibSubRootEntry = FindEntry( pLibRootEntry, aEntryName, eType ); + if( pLibSubRootEntry ) + { + SetEntryBitmaps( pLibSubRootEntry, Image( IDEResId( RID_IMG_MODLIB ) ), Image( IDEResId( RID_IMG_MODLIB_HC ) ) ); + if ( IsExpanded( pLibSubRootEntry ) ) + ImpCreateLibSubSubEntriesInVBAMode( pLibSubRootEntry, rDocument, rLibName ); + } + else + { + pLibSubRootEntry = AddEntry( + aEntryName, + Image( IDEResId( RID_IMG_MODLIB ) ), + Image( IDEResId( RID_IMG_MODLIB_HC ) ), + pLibRootEntry, true, + std::auto_ptr< BasicEntry >( new BasicEntry( eType ) ) ); + } + } +} + +void BasicTreeListBox::ImpCreateLibSubSubEntriesInVBAMode( SvLBoxEntry* pLibSubRootEntry, const ScriptDocument& rDocument, const String& rLibName ) +{ + uno::Reference< container::XNameContainer > xLib = rDocument.getOrCreateLibrary( E_SCRIPTS, rLibName ); + if( !xLib.is() ) + return; + + try + { + // get a sorted list of module names + Sequence< ::rtl::OUString > aModNames = rDocument.getObjectNames( E_SCRIPTS, rLibName ); + sal_Int32 nModCount = aModNames.getLength(); + const ::rtl::OUString* pModNames = aModNames.getConstArray(); + + BasicEntryDescriptor aDesc( GetEntryDescriptor( pLibSubRootEntry ) ); + BasicEntryType eCurrentType( aDesc.GetType() ); + + for ( sal_Int32 i = 0 ; i < nModCount ; i++ ) + { + String aModName = pModNames[ i ]; + BasicEntryType eType = OBJ_TYPE_UNKNOWN; + switch( ModuleInfoHelper::getModuleType( xLib, aModName ) ) + { + case script::ModuleType::DOCUMENT: + eType = OBJ_TYPE_DOCUMENT_OBJECTS; + break; + case script::ModuleType::FORM: + eType = OBJ_TYPE_USERFORMS; + break; + case script::ModuleType::NORMAL: + eType = OBJ_TYPE_NORMAL_MODULES; + break; + case script::ModuleType::CLASS: + eType = OBJ_TYPE_CLASS_MODULES; + break; + } + if( eType != eCurrentType ) + continue; + + // display a nice friendly name in the ObjectModule tab, + // combining the objectname and module name, e.g. Sheet1 ( Financials ) + String aEntryName( aModName ); + if( eType == OBJ_TYPE_DOCUMENT_OBJECTS ) + { + String sObjName; + ModuleInfoHelper::getObjectName( xLib, aModName, sObjName ); + if( sObjName.Len() ) + { + aEntryName.AppendAscii(" (").Append(sObjName).AppendAscii(")"); + } + } + SvLBoxEntry* pModuleEntry = FindEntry( pLibSubRootEntry, aEntryName, OBJ_TYPE_MODULE ); + if ( !pModuleEntry ) + pModuleEntry = AddEntry( + aEntryName, + Image( IDEResId( RID_IMG_MODULE ) ), + Image( IDEResId( RID_IMG_MODULE_HC ) ), + pLibSubRootEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); + + // methods + if ( nMode & BROWSEMODE_SUBS ) + { + Sequence< ::rtl::OUString > aNames = BasicIDE::GetMethodNames( rDocument, rLibName, aModName ); + sal_Int32 nCount = aNames.getLength(); + const ::rtl::OUString* pNames = aNames.getConstArray(); + + for ( sal_Int32 j = 0 ; j < nCount ; j++ ) + { + String aName = pNames[ j ]; + SvLBoxEntry* pEntry = FindEntry( pModuleEntry, aName, OBJ_TYPE_METHOD ); + if ( !pEntry ) + pEntry = AddEntry( + aName, + Image( IDEResId( RID_IMG_MACRO ) ), + Image( IDEResId( RID_IMG_MACRO_HC ) ), + pModuleEntry, false, + std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_METHOD ) ) ); + } + } + } + } + catch ( const container::NoSuchElementException& ) + { + DBG_UNHANDLED_EXCEPTION(); + } +} + +SvLBoxEntry* BasicTreeListBox::ImpFindEntry( SvLBoxEntry* pParent, const String& rText ) +{ + ULONG nRootPos = 0; + SvLBoxEntry* pEntry = pParent ? FirstChild( pParent ) : GetEntry( nRootPos ); + while ( pEntry ) + { + if ( GetEntryText( pEntry ) == rText ) + return pEntry; + + pEntry = pParent ? NextSibling( pEntry ) : GetEntry( ++nRootPos ); + } + return 0; +} + void BasicTreeListBox::onDocumentCreated( const ScriptDocument& /*_rDocument*/ ) { UpdateEntries(); @@ -477,10 +662,11 @@ long BasicTreeListBox::ExpandingHdl() if ( aDocument.isAlive() ) { String aLibName( aDesc.GetLibName() ); + String aLibSubName( aDesc.GetLibSubName() ); String aName( aDesc.GetName() ); String aMethodName( aDesc.GetMethodName() ); - if ( aLibName.Len() && !aName.Len() && !aMethodName.Len() ) + if ( aLibName.Len() && !aLibSubName.Len() && !aName.Len() && !aMethodName.Len() ) { // check password, if library is password protected and not verified ::rtl::OUString aOULibName( aLibName ); @@ -633,7 +819,7 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc ) aDesc = BasicEntryDescriptor( ScriptDocument::getApplicationScriptDocument(), LIBRARY_LOCATION_USER, String::CreateFromAscii( "Standard" ), - String::CreateFromAscii( "." ), OBJ_TYPE_UNKNOWN ); + String(), String::CreateFromAscii( "." ), OBJ_TYPE_UNKNOWN ); } ScriptDocument aDocument( aDesc.GetDocument() ); OSL_ENSURE( aDocument.isValid(), "BasicTreeListBox::SetCurrentEntry: invalid document!" ); @@ -650,14 +836,24 @@ void BasicTreeListBox::SetCurrentEntry( BasicEntryDescriptor& rDesc ) if ( pLibEntry ) { pCurEntry = pLibEntry; + String aLibSubName( aDesc.GetLibSubName() ); + if( aLibSubName.Len() ) + { + Expand( pLibEntry ); + SvLBoxEntry* pLibSubEntry = ImpFindEntry( pLibEntry, aLibSubName ); + if( pLibSubEntry ) + { + pCurEntry = pLibSubEntry; + } + } String aName( aDesc.GetName() ); if ( aName.Len() ) { - Expand( pLibEntry ); + Expand( pCurEntry ); BasicEntryType eType = OBJ_TYPE_MODULE; if ( aDesc.GetType() == OBJ_TYPE_DIALOG ) eType = OBJ_TYPE_DIALOG; - SvLBoxEntry* pEntry = FindEntry( pLibEntry, aName, eType ); + SvLBoxEntry* pEntry = FindEntry( pCurEntry, aName, eType ); if ( pEntry ) { pCurEntry = pEntry; diff --git a/basctl/source/basicide/bastype2.hxx b/basctl/source/basicide/bastype2.hxx index 401282f7e1bf..4b4d42f477d0 100644 --- a/basctl/source/basicide/bastype2.hxx +++ b/basctl/source/basicide/bastype2.hxx @@ -39,7 +39,7 @@ #include <sbxitem.hxx> #include "basobj.hxx" -enum BasicEntryType { OBJ_TYPE_UNKNOWN, OBJ_TYPE_DOCUMENT, OBJ_TYPE_LIBRARY, OBJ_TYPE_MODULE, OBJ_TYPE_DIALOG, OBJ_TYPE_METHOD }; +enum BasicEntryType { OBJ_TYPE_UNKNOWN, OBJ_TYPE_DOCUMENT, OBJ_TYPE_LIBRARY, OBJ_TYPE_MODULE, OBJ_TYPE_DIALOG, OBJ_TYPE_METHOD, OBJ_TYPE_DOCUMENT_OBJECTS, OBJ_TYPE_USERFORMS, OBJ_TYPE_NORMAL_MODULES, OBJ_TYPE_CLASS_MODULES }; #define BROWSEMODE_MODULES 0x01 #define BROWSEMODE_SUBS 0x02 @@ -98,14 +98,15 @@ class BasicEntryDescriptor ScriptDocument m_aDocument; LibraryLocation m_eLocation; String m_aLibName; + String m_aLibSubName; // for vba entry: Document Objects, Class Modules, Forms and Normal Modules String m_aName; String m_aMethodName; BasicEntryType m_eType; public: BasicEntryDescriptor(); - BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, BasicEntryType eType ); - BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rName, const String& rMethodName, BasicEntryType eType ); + BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, BasicEntryType eType ); + BasicEntryDescriptor( const ScriptDocument& rDocument, LibraryLocation eLocation, const String& rLibName, const String& rLibSubName, const String& rName, const String& rMethodName, BasicEntryType eType ); virtual ~BasicEntryDescriptor(); BasicEntryDescriptor( const BasicEntryDescriptor& rDesc ); @@ -122,6 +123,9 @@ public: const String& GetLibName() const { return m_aLibName; } void SetLibName( const String& aLibName ) { m_aLibName = aLibName; } + const String& GetLibSubName() const { return m_aLibSubName; } + void SetLibSubName( const String& aLibSubName ) { m_aLibSubName = aLibSubName; } + const String& GetName() const { return m_aName; } void SetName( const String& aName ) { m_aName = aName; } @@ -161,6 +165,9 @@ protected: void ImpCreateLibEntries( SvLBoxEntry* pShellRootEntry, const ScriptDocument& rDocument, LibraryLocation eLocation ); void ImpCreateLibSubEntries( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName ); + void ImpCreateLibSubEntriesInVBAMode( SvLBoxEntry* pLibRootEntry, const ScriptDocument& rDocument, const String& rLibName ); + void ImpCreateLibSubSubEntriesInVBAMode( SvLBoxEntry* pLibSubRootEntry, const ScriptDocument& rDocument, const String& rLibName ); + SvLBoxEntry* ImpFindEntry( SvLBoxEntry* pParent, const String& rText ); // DocumentEventListener virtual void onDocumentCreated( const ScriptDocument& _rDocument ); diff --git a/basctl/source/basicide/bastype3.cxx b/basctl/source/basicide/bastype3.cxx index a0320d89e88a..de9eff56ca24 100644 --- a/basctl/source/basicide/bastype3.cxx +++ b/basctl/source/basicide/bastype3.cxx @@ -131,6 +131,14 @@ void __EXPORT BasicTreeListBox::RequestingChilds( SvLBoxEntry* pEntry ) } } } + else if ( eType == OBJ_TYPE_DOCUMENT_OBJECTS + || eType == OBJ_TYPE_USERFORMS + || eType == OBJ_TYPE_NORMAL_MODULES + || eType == OBJ_TYPE_CLASS_MODULES ) + { + String aLibName( aDesc.GetLibName() ); + ImpCreateLibSubSubEntriesInVBAMode( pEntry, aDocument, aLibName ); + } else { DBG_ERROR( "BasicTreeListBox::RequestingChilds: Unknown Type!" ); } @@ -201,6 +209,7 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) } SbxVariable* pVar = 0; + bool bDocumentObjects = false; if ( aEntries.Count() ) { for ( USHORT n = 0; n < aEntries.Count(); n++ ) @@ -223,6 +232,12 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) case OBJ_TYPE_MODULE: { DBG_ASSERT( pVar && pVar->IsA( TYPE(StarBASIC) ), "FindVariable: Ungueltiges Basic" ); + // extract the module name from the string like "Sheet1 (Example1)" + if( bDocumentObjects ) + { + sal_uInt16 nIndex = 0; + aName = aName.GetToken( 0, ' ', nIndex ); + } pVar = ((StarBASIC*)pVar)->FindModule( aName ); } break; @@ -237,6 +252,15 @@ SbxVariable* BasicTreeListBox::FindVariable( SvLBoxEntry* pEntry ) // sbx dialogs removed } break; + case OBJ_TYPE_DOCUMENT_OBJECTS: + bDocumentObjects = true; + case OBJ_TYPE_USERFORMS: + case OBJ_TYPE_NORMAL_MODULES: + case OBJ_TYPE_CLASS_MODULES: + { + // skip, to find the child entry. + continue; + } default: { DBG_ERROR( "FindVariable: Unbekannter Typ!" ); @@ -257,12 +281,13 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry ) ScriptDocument aDocument( ScriptDocument::getApplicationScriptDocument() ); LibraryLocation eLocation = LIBRARY_LOCATION_UNKNOWN; String aLibName; + String aLibSubName; String aName; String aMethodName; BasicEntryType eType = OBJ_TYPE_UNKNOWN; if ( !pEntry ) - return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType ); + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType ); EntryArray aEntries; @@ -329,6 +354,15 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry ) eType = pBE->GetType(); } break; + case OBJ_TYPE_DOCUMENT_OBJECTS: + case OBJ_TYPE_USERFORMS: + case OBJ_TYPE_NORMAL_MODULES: + case OBJ_TYPE_CLASS_MODULES: + { + aLibSubName = GetEntryText( pLE ); + eType = pBE->GetType(); + } + break; default: { DBG_ERROR( "GetEntryDescriptor: Unbekannter Typ!" ); @@ -342,7 +376,7 @@ BasicEntryDescriptor BasicTreeListBox::GetEntryDescriptor( SvLBoxEntry* pEntry ) } } - return BasicEntryDescriptor( aDocument, eLocation, aLibName, aName, aMethodName, eType ); + return BasicEntryDescriptor( aDocument, eLocation, aLibName, aLibSubName, aName, aMethodName, eType ); } USHORT BasicTreeListBox::ConvertType( BasicEntryType eType ) @@ -424,6 +458,14 @@ bool BasicTreeListBox::IsValidEntry( SvLBoxEntry* pEntry ) bIsValid = BasicIDE::HasMethod( aDocument, aLibName, aName, aMethodName ); } break; + case OBJ_TYPE_DOCUMENT_OBJECTS: + case OBJ_TYPE_USERFORMS: + case OBJ_TYPE_NORMAL_MODULES: + case OBJ_TYPE_CLASS_MODULES: + { + bIsValid = true; + } + break; default: ; } diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx index af42503a5dae..150e10a5a76f 100644 --- a/basctl/source/basicide/bastypes.cxx +++ b/basctl/source/basicide/bastypes.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/script/XLibraryContainer2.hpp> #endif #include <com/sun/star/script/XLibraryContainerPassword.hpp> +#include <com/sun/star/script/ModuleType.hpp> using namespace ::com::sun::star::uno; using namespace ::com::sun::star; @@ -584,8 +585,32 @@ void __EXPORT BasicIDETabBar::Command( const CommandEvent& rCEvt ) aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE ); aPopup.RemoveDisabledEntries(); } + if ( aDocument.isInVBAMode() ) + { + // disable to delete or remove object modules in IDE + BasicManager* pBasMgr = aDocument.getBasicManager(); + if ( pBasMgr ) + { + StarBASIC* pBasic = pBasMgr->GetLib( aOULibName ); + if( pBasic ) + { + IDEWindowTable& aIDEWindowTable = pIDEShell->GetIDEWindowTable(); + IDEBaseWindow* pWin = aIDEWindowTable.Get( GetCurPageId() ); + if( pWin && pWin->ISA( ModulWindow ) ) + { + SbModule* pActiveModule = (SbModule*)pBasic->FindModule( pWin->GetName() ); + if( pActiveModule && ( pActiveModule->GetModuleType() == script::ModuleType::DOCUMENT ) ) + { + aPopup.EnableItem( SID_BASICIDE_DELETECURRENT, FALSE ); + aPopup.EnableItem( SID_BASICIDE_RENAMECURRENT, FALSE ); + } + } + } + } + } } + SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL; if ( pDispatcher ) diff --git a/basctl/source/basicide/macrodlg.cxx b/basctl/source/basicide/macrodlg.cxx index f3e41e60d34b..41a5fa488950 100644 --- a/basctl/source/basicide/macrodlg.cxx +++ b/basctl/source/basicide/macrodlg.cxx @@ -382,7 +382,15 @@ SbMethod* MacroChooser::CreateMacro() SbModule* pModule = 0; String aModName( aDesc.GetName() ); if ( aModName.Len() ) + { + // extract the module name from the string like "Sheet1 (Example1)" + if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) + { + sal_uInt16 nIndex = 0; + aModName = aModName.GetToken( 0, ' ', nIndex ); + } pModule = pBasic->FindModule( aModName ); + } else if ( pBasic->GetModules()->Count() ) pModule = (SbModule*)pBasic->GetModules()->Get( 0 ); @@ -710,6 +718,12 @@ IMPL_LINK( MacroChooser, ButtonHdl, Button *, pButton ) BasicManager* pBasMgr = aDocument.getBasicManager(); String aLib( aDesc.GetLibName() ); String aMod( aDesc.GetName() ); + // extract the module name from the string like "Sheet1 (Example1)" + if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) + { + sal_uInt16 nIndex = 0; + aMod = aMod.GetToken( 0, ' ', nIndex ); + } String aSub( aDesc.GetMethodName() ); SfxMacroInfoItem aInfoItem( SID_BASICIDE_ARG_MACROINFO, pBasMgr, aLib, aMod, aSub, String() ); if ( pButton == &aEditButton ) diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index 478d56546f41..0f66a6ebe120 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -84,7 +84,7 @@ BOOL __EXPORT ExtBasicTreeListBox::EditingEntry( SvLBoxEntry* pEntry, Selection& if ( pEntry ) { USHORT nDepth = GetModel()->GetDepth( pEntry ); - if ( nDepth == 2 ) + if ( nDepth >= 2 ) { BasicEntryDescriptor aDesc( GetEntryDescriptor( pEntry ) ); ScriptDocument aDocument( aDesc.GetDocument() ); @@ -162,7 +162,7 @@ DragDropMode __EXPORT ExtBasicTreeListBox::NotifyStartDrag( TransferDataContaine if ( pEntry ) { USHORT nDepth = GetModel()->GetDepth( pEntry ); - if ( nDepth == 2 ) + if ( nDepth >= 2 ) { nMode_ = SV_DRAGDROP_CTRL_COPY; BasicEntryDescriptor aDesc( GetEntryDescriptor( pEntry ) ); @@ -210,7 +210,7 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyAcceptDrop( SvLBoxEntry* pEntry ) // don't drop on a library, which is not loaded, readonly or password protected // or which already has a module/dialog with this name - if ( bValid && ( nDepth == 1 || nDepth == 2 ) ) + if ( bValid && ( nDepth > 0 ) ) { // get source module/dialog name BasicEntryDescriptor aSourceDesc( GetEntryDescriptor( pSelected ) ); @@ -348,7 +348,7 @@ BOOL __EXPORT ExtBasicTreeListBox::NotifyCopyingMoving( SvLBoxEntry* pTarget, Sv rpNewParent = pTarget; rNewChildPos = 0; } - else if ( nDepth == 2 ) + else if ( nDepth >= 2 ) { // Target = Modul/Dialog => Modul/Dialog unter das uebergeordnete Basic haengen... rpNewParent = GetParent( pTarget ); @@ -623,20 +623,29 @@ void ObjectPage::CheckButtons() { // enable/disable edit button SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); + BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) ); + ScriptDocument aDocument( aDesc.GetDocument() ); + ::rtl::OUString aOULibName( aDesc.GetLibName() ); + String aLibSubName( aDesc.GetLibSubName() ); + sal_Bool bVBAEnabled = aDocument.isInVBAMode(); + USHORT nMode = aBasicBox.GetMode(); + USHORT nDepth = pCurEntry ? aBasicBox.GetModel()->GetDepth( pCurEntry ) : 0; - if ( nDepth == 2 ) + if ( nDepth >= 2 ) + { + if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( nDepth == 2 ) ) + aEditButton.Disable(); + else aEditButton.Enable(); + } else aEditButton.Disable(); // enable/disable new module/dialog buttons - BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) ); LibraryLocation eLocation( aDesc.GetLocation() ); BOOL bReadOnly = FALSE; - if ( nDepth == 1 || nDepth == 2 ) + if ( nDepth > 0 ) { - ScriptDocument aDocument( aDesc.GetDocument() ); - ::rtl::OUString aOULibName( aDesc.GetLibName() ); Reference< script::XLibraryContainer2 > xModLibContainer( aDocument.getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); Reference< script::XLibraryContainer2 > xDlgLibContainer( aDocument.getLibraryContainer( E_DIALOGS ), UNO_QUERY ); if ( ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) && xModLibContainer->isLibraryReadOnly( aOULibName ) ) || @@ -657,8 +666,13 @@ void ObjectPage::CheckButtons() } // enable/disable delete button - if ( nDepth == 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE ) + if ( nDepth >= 2 && !bReadOnly && eLocation != LIBRARY_LOCATION_SHARE ) + { + if( bVBAEnabled && ( nMode & BROWSEMODE_MODULES ) && ( ( nDepth == 2 ) || aLibSubName.Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) ) + aDelButton.Disable(); + else aDelButton.Enable(); + } else aDelButton.Disable(); } @@ -685,13 +699,20 @@ IMPL_LINK( ObjectPage, ButtonHdl, Button *, pButton ) SfxDispatcher* pDispatcher = pViewFrame ? pViewFrame->GetDispatcher() : NULL; SvLBoxEntry* pCurEntry = aBasicBox.GetCurEntry(); DBG_ASSERT( pCurEntry, "Entry?!" ); - if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) == 2 ) + if ( aBasicBox.GetModel()->GetDepth( pCurEntry ) >= 2 ) { BasicEntryDescriptor aDesc( aBasicBox.GetEntryDescriptor( pCurEntry ) ); if ( pDispatcher ) { + String aModName( aDesc.GetName() ); + // extract the module name from the string like "Sheet1 (Example1)" + if( aDesc.GetLibSubName().Equals( String( IDEResId( RID_STR_DOCUMENT_OBJECTS ) ) ) ) + { + sal_uInt16 nIndex = 0; + aModName = aModName.GetToken( 0, ' ', nIndex ); + } SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, aDesc.GetDocument(), aDesc.GetLibName(), - aDesc.GetName(), aBasicBox.ConvertType( aDesc.GetType() ) ); + aModName, aBasicBox.ConvertType( aDesc.GetType() ) ); pDispatcher->Execute( SID_BASICIDE_SHOWSBX, SFX_CALLMODE_SYNCHRON, &aSbxItem, 0L ); } } @@ -973,14 +994,14 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument, try { ::rtl::OUString sModuleCode; + // the module has existed + if( rDocument.hasModule( aLibName, aModName ) ) + return NULL; rDocument.createModule( aLibName, aModName, bMain, sModuleCode ); BasicManager* pBasMgr = rDocument.getBasicManager(); - if ( pBasMgr ) - { - StarBASIC* pBasic = pBasMgr->GetLib( aLibName ); + StarBASIC* pBasic = pBasMgr? pBasMgr->GetLib( aLibName ) : 0; if ( pBasic ) pModule = pBasic->FindModule( aModName ); - } SbxItem aSbxItem( SID_BASICIDE_ARG_SBX, rDocument, aLibName, aModName, BASICIDE_TYPE_MODULE ); BasicIDEShell* pIDEShell = IDE_DLL()->GetShell(); SfxViewFrame* pViewFrame = pIDEShell ? pIDEShell->GetViewFrame() : NULL; @@ -1002,14 +1023,27 @@ SbModule* createModImpl( Window* pWin, const ScriptDocument& rDocument, { if ( !rBasicBox.IsExpanded( pLibEntry ) ) rBasicBox.Expand( pLibEntry ); - SvLBoxEntry* pEntry = rBasicBox.FindEntry( pLibEntry, aModName, OBJ_TYPE_MODULE ); + SvLBoxEntry* pSubRootEntry = pLibEntry; + if( pBasic && rDocument.isInVBAMode() ) + { + // add the new module in the "Modules" entry + SvLBoxEntry* pLibSubEntry = rBasicBox.FindEntry( pLibEntry, String( IDEResId( RID_STR_NORMAL_MODULES ) ) , OBJ_TYPE_NORMAL_MODULES ); + if( pLibSubEntry ) + { + if( !rBasicBox.IsExpanded( pLibSubEntry ) ) + rBasicBox.Expand( pLibSubEntry ); + pSubRootEntry = pLibSubEntry; + } + } + + SvLBoxEntry* pEntry = rBasicBox.FindEntry( pSubRootEntry, aModName, OBJ_TYPE_MODULE ); if ( !pEntry ) { pEntry = rBasicBox.AddEntry( aModName, Image( IDEResId( RID_IMG_MODULE ) ), Image( IDEResId( RID_IMG_MODULE_HC ) ), - pLibEntry, false, + pSubRootEntry, false, std::auto_ptr< BasicEntry >( new BasicEntry( OBJ_TYPE_MODULE ) ) ); DBG_ASSERT( pEntry, "InsertEntry fehlgeschlagen!" ); } diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx index 8dcacad64179..1f1d8ab6145b 100644 --- a/basctl/source/basicide/scriptdocument.cxx +++ b/basctl/source/basicide/scriptdocument.cxx @@ -53,6 +53,8 @@ #include <com/sun/star/frame/XModel2.hpp> #include <com/sun/star/awt/XWindow2.hpp> #include <com/sun/star/document/XEmbeddedScripts.hpp> +#include <com/sun/star/script/XVBAModuleInfo.hpp> +#include <com/sun/star/script/XVBACompat.hpp> /** === end UNO includes === **/ #include <sfx2/objsh.hxx> @@ -139,6 +141,9 @@ namespace basctl using ::com::sun::star::uno::RuntimeException; using ::com::sun::star::document::XEventBroadcaster; using ::com::sun::star::document::XEmbeddedScripts; + using ::com::sun::star::script::ModuleInfo; + using ::com::sun::star::script::XVBAModuleInfo; + using ::com::sun::star::script::XVBACompat; /** === end UNO using === **/ namespace MacroExecMode = ::com::sun::star::document::MacroExecMode; namespace FrameSearchFlag = ::com::sun::star::frame::FrameSearchFlag; @@ -272,6 +277,7 @@ namespace basctl // versions with the same signature/semantics as in ScriptDocument itself bool isReadOnly() const; + bool isInVBAMode() const; BasicManager* getBasicManager() const; Reference< XModel > @@ -444,6 +450,20 @@ namespace basctl return bIsReadOnly; } + bool ScriptDocument_Impl::isInVBAMode() const + { + bool bResult = false; +#ifdef FUTURE_VBA_CWS + if ( !isApplication() ) + { + Reference< XVBACompat > xVBACompat( getLibraryContainer( E_SCRIPTS ), UNO_QUERY ); + if ( xVBACompat.is() ) + bResult = xVBACompat->getVBACompatModeOn(); + } +#endif + return bResult; + } + //-------------------------------------------------------------------- BasicManager* ScriptDocument_Impl::getBasicManager() const { @@ -671,6 +691,16 @@ namespace basctl } // insert element by new name in container + else if ( _eType == E_SCRIPTS ) + { + Reference< XVBAModuleInfo > xVBAModuleInfo( xLib, UNO_QUERY ); + if ( xVBAModuleInfo->hasModuleInfo( _rOldName ) ) + { + ModuleInfo sModuleInfo = xVBAModuleInfo->getModuleInfo( _rOldName ); + xVBAModuleInfo->removeModuleInfo( _rOldName ); + xVBAModuleInfo->insertModuleInfo( _rNewName, sModuleInfo ); + } + } xLib->insertByName( _rNewName, aElement ); return true; } @@ -735,7 +765,6 @@ namespace basctl Reference< XNameContainer > xLib( getOrCreateLibrary( E_SCRIPTS, _rLibName ), UNO_QUERY_THROW ); if ( !xLib->hasByName( _rModName ) ) return false; - xLib->replaceByName( _rModName, makeAny( _rModuleCode ) ); return true; } @@ -1354,6 +1383,11 @@ namespace basctl return m_pImpl->isApplication(); } + bool ScriptDocument::isInVBAMode() const + { + return m_pImpl->isInVBAMode(); + } + //-------------------------------------------------------------------- BasicManager* ScriptDocument::getBasicManager() const { diff --git a/basctl/source/inc/basidesh.hxx b/basctl/source/inc/basidesh.hxx index cf21d3488dd3..07bc2dfa3149 100644 --- a/basctl/source/inc/basidesh.hxx +++ b/basctl/source/inc/basidesh.hxx @@ -46,6 +46,7 @@ #include <com/sun/star/io/XInputStreamProvider.hpp> #endif +#include <com/sun/star/container/XContainerListener.hpp> //---------------------------------------------------------------------------- @@ -105,6 +106,8 @@ friend bool BasicIDE::RemoveDialog( const ScriptDocument& rDocument, const Strin BOOL m_bAppBasicModified; ::basctl::DocumentEventNotifier m_aNotifier; +friend class ContainerListenerImpl; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener > m_xLibListener; #if _SOLAR__PRIVATE void Init(); diff --git a/basctl/source/inc/bastypes.hxx b/basctl/source/inc/bastypes.hxx index c9981001e456..bc588fccaf14 100644 --- a/basctl/source/inc/bastypes.hxx +++ b/basctl/source/inc/bastypes.hxx @@ -328,5 +328,13 @@ BOOL QueryDelModule( const String& rName, Window* pParent = 0 ); BOOL QueryDelLib( const String& rName, BOOL bRef = FALSE, Window* pParent = 0 ); BOOL QueryPassword( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XLibraryContainer >& xLibContainer, const String& rLibName, String& rPassword, BOOL bRepeat = FALSE, BOOL bNewTitle = FALSE ); - +class ModuleInfoHelper +{ +ModuleInfoHelper(); +ModuleInfoHelper(const ModuleInfoHelper&); +ModuleInfoHelper& operator = (const ModuleInfoHelper&); +public: + static void getObjectName( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rLib, const String& rModName, String& rObjName ); + static sal_Int32 getModuleType( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer >& rLib, const String& rModName ); +}; #endif // _BASTYPES_HXX diff --git a/basctl/source/inc/scriptdocument.hxx b/basctl/source/inc/scriptdocument.hxx index 34d1a72963ce..9439c05f7249 100644 --- a/basctl/source/inc/scriptdocument.hxx +++ b/basctl/source/inc/scriptdocument.hxx @@ -212,6 +212,7 @@ namespace basctl */ bool isAlive() const; + bool isInVBAMode() const; /// returns the BasicManager associated with this instance BasicManager* getBasicManager() const; diff --git a/cui/source/dialogs/hldoctp.cxx b/cui/source/dialogs/hldoctp.cxx index d8e5878c3a8e..a87d7710f484 100644 --- a/cui/source/dialogs/hldoctp.cxx +++ b/cui/source/dialogs/hldoctp.cxx @@ -39,7 +39,6 @@ sal_Char __READONLY_DATA sHash[] = "#"; sal_Char __READONLY_DATA sFileScheme[] = INET_FILE_SCHEME; -sal_Char __READONLY_DATA sPortalFileScheme[] = "vnd.sun.star.wfs://"; sal_Char __READONLY_DATA sNewsSRVScheme[] = "news://"; // TODO news:// is nonsense sal_Char __READONLY_DATA sHTTPScheme[] = INET_HTTP_SCHEME; @@ -170,8 +169,7 @@ void SvxHyperlinkDocTp::GetCurentItemData ( String& aStrURL, String& aStrName, // get data from standard-fields aStrURL = GetCurrentURL(); - if( aStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - aStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ) + if( aStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) aStrURL=aEmptyStr; GetDataFromCommonFields( aStrName, aStrIntName, aStrFrame, eMode ); @@ -212,8 +210,7 @@ IMPL_LINK ( SvxHyperlinkDocTp, ClickFileopenHdl_Impl, void *, EMPTYARG ) com::sun::star::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, 0, GetParent() ); String aOldURL( GetCurrentURL() ); - if( aOldURL.EqualsIgnoreCaseAscii( sFileScheme, 0, sizeof( sFileScheme ) - 1 ) || - aOldURL.EqualsIgnoreCaseAscii( sPortalFileScheme, 0, sizeof( sFileScheme ) - 1 ) ) + if( aOldURL.EqualsIgnoreCaseAscii( sFileScheme, 0, sizeof( sFileScheme ) - 1 ) ) { aDlg.SetDisplayDirectory( aOldURL ); } @@ -250,15 +247,13 @@ IMPL_LINK ( SvxHyperlinkDocTp, ClickTargetHdl_Impl, void *, EMPTYARG ) if ( GetPathType ( maStrURL ) == Type_ExistsFile || maStrURL == aEmptyStr || maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) || maStrURL.SearchAscii( sHash ) == 0 ) { mpMarkWnd->SetError( LERR_NOERROR ); EnterWait(); - if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ) + if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) mpMarkWnd->RefreshTree ( aEmptyStr ); else mpMarkWnd->RefreshTree ( maStrURL ); @@ -305,8 +300,7 @@ IMPL_LINK ( SvxHyperlinkDocTp, TimeoutHdl_Impl, Timer *, EMPTYARG ) { EnterWait(); - if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) || - maStrURL.EqualsIgnoreCaseAscii( sPortalFileScheme ) ) + if ( maStrURL.EqualsIgnoreCaseAscii( sFileScheme ) ) mpMarkWnd->RefreshTree ( aEmptyStr ); else mpMarkWnd->RefreshTree ( maStrURL ); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index f1651b0bd1dd..b63d9afc647e 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -129,6 +129,13 @@ #include <svx/drawitem.hxx> #include <rtl/uri.hxx> +#ifdef LINUX +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <unistd.h> +#endif + using namespace ::com::sun::star; using namespace ::com::sun::star::beans; using namespace ::com::sun::star::container; @@ -2195,6 +2202,28 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame ) if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN ) continue; #endif +#ifdef LINUX + // Disable Mozilla Plug-in tab-page on Linux if we find a + // globally installed plugin + if ( nPageId == RID_SVXPAGE_INET_MOZPLUGIN ) { + struct stat sb; + char *p; + bool bHaveSystemWidePlugin = false; + char mozpaths[]="/usr/lib/mozilla/plugins/libnpsoplugin.so:/usr/lib/firefox/plugins/libnpsoplugin.so:/usr/lib/mozilla-firefox/plugins/libnpsoplugin.so:/usr/lib/iceweasel/plugins/libnpsoplugin.so:/usr/lib/iceape/plugins/libnpsoplugin.so:/usr/lib/browser-plugins/libnpsoplugin.so:/usr/lib64/browser-plugins/libnpsoplugin.so"; + + p = strtok(mozpaths, ":"); + while (p != NULL) { + if (stat(p, &sb) != -1) { + bHaveSystemWidePlugin = true; + break; + } + p = strtok(NULL, ":"); + } + + if (bHaveSystemWidePlugin == true) + continue; + } +#endif AddTabPage( nPageId, rInetArray.GetString(i), nGroup ); } } diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx index 696c1c62cb23..1f166b8f8d41 100644 --- a/cui/source/tabpages/chardlg.cxx +++ b/cui/source/tabpages/chardlg.cxx @@ -3386,11 +3386,6 @@ USHORT* SvxCharPositionPage::GetRanges() } // ----------------------------------------------------------------------- -#define ENABLE_AND_CHECK( aCheckBox ) \ - if ( !aCheckBox.IsEnabled() ) \ - aCheckBox.Enable(); \ - aCheckBox.Check( TRUE ) - void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) { String sUser = GetUserData(); @@ -3431,6 +3426,7 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_aFontSizeEdit.Enable(); short nFac; + sal_Bool bAutomatic(sal_False); if ( nEsc > 0 ) { @@ -3438,8 +3434,8 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_aHighPosBtn.Check( TRUE ); if ( nEsc == DFLT_ESC_AUTO_SUPER ) { - ENABLE_AND_CHECK( m_aHighLowRB ); nEsc = DFLT_ESC_SUPER; + bAutomatic = sal_True; } } else @@ -3448,10 +3444,15 @@ void SvxCharPositionPage::Reset( const SfxItemSet& rSet ) m_aLowPosBtn.Check( TRUE ); if ( nEsc == DFLT_ESC_AUTO_SUB ) { - ENABLE_AND_CHECK( m_aHighLowRB ); nEsc = DFLT_ESC_SUB; + bAutomatic = sal_True; } } + if (!m_aHighLowRB.IsEnabled()) + { + m_aHighLowRB.Enable(); + } + m_aHighLowRB.Check(bAutomatic); if ( m_aHighLowRB.IsChecked() ) { diff --git a/extensions/prj/build.lst b/extensions/prj/build.lst index 0885b3021c61..1489e2a4e0e4 100644 --- a/extensions/prj/build.lst +++ b/extensions/prj/build.lst @@ -34,4 +34,3 @@ ex extensions\source\update\feed nmake - all ex_updchkfeed ex ex extensions\source\update\check nmake - all ex_updchk ex_inc NULL ex extensions\source\update\ui nmake - all ex_updchkui ex_inc NULL ex extensions\util nmake - all ex_util ex_preload ex_abpilot ex_dbpilots ex_logging ex_ldap ex_propctrlr ex_bib ex_plutil ex_oooimprovecore NULL -ex extensions\qa\unoapi nmake - all ex_qa_unoapi NULL diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx index 07bca1490e35..178948ae0d3a 100644 --- a/extensions/source/abpilot/datasourcehandling.cxx +++ b/extensions/source/abpilot/datasourcehandling.cxx @@ -347,25 +347,6 @@ namespace abp //= ODataSource //===================================================================== //--------------------------------------------------------------------- - ODataSource::ODataSource( const Reference< XMultiServiceFactory >& _rxORB, const ::rtl::OUString& _rName ) - :m_pImpl(new ODataSourceImpl(_rxORB)) - { - try - { - // get the data source context - Reference< XNameAccess > xContext = lcl_getDataSourceContext( m_pImpl->xORB ); - - // retrieve the UNO data source - if (xContext.is()) - xContext->getByName( _rName ) >>= m_pImpl->xDataSource; - } - catch(const Exception&) - { - DBG_ERROR("ODataSource::ODataSource: could not access the requested data source (caught an exception)!"); - } - } - - //--------------------------------------------------------------------- ODataSource::ODataSource( const ODataSource& _rSource ) :m_pImpl( NULL ) { diff --git a/extensions/source/abpilot/datasourcehandling.hxx b/extensions/source/abpilot/datasourcehandling.hxx index bcd4e64fd885..54819b9b9628 100644 --- a/extensions/source/abpilot/datasourcehandling.hxx +++ b/extensions/source/abpilot/datasourcehandling.hxx @@ -125,17 +125,6 @@ namespace abp // ---------------------------------------------------------------- // - ctor/dtor/assignment // ---------------------------------------------------------------- - /** ctor - @param _rxORB - the service factory to use to access the UNO objects - @param _rName - the name of the data source the object should represent - */ - ODataSource( - const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, - const ::rtl::OUString& _rName - ); - /// constructs an object which is initially invalid ODataSource( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB diff --git a/extensions/source/activex/main/so_activex.cpp b/extensions/source/activex/main/so_activex.cpp index 9c10fadadb06..b5793f6c7274 100644 --- a/extensions/source/activex/main/so_activex.cpp +++ b/extensions/source/activex/main/so_activex.cpp @@ -44,8 +44,10 @@ const REGSAM n32KeyAccess = KEY_ALL_ACCESS; #ifdef _AMD64_ const BOOL bX64 = TRUE; +#define REG_DELETE_KEY_A( key, aPath, nKeyAccess ) RegDeleteKeyExA( key, aPath, nKeyAccess, 0 ) #else const BOOL bX64 = FALSE; +#define REG_DELETE_KEY_A( key, aPath, nKeyAccess ) RegDeleteKeyA( key, aPath ) #endif // 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExA if WINVER < 0x0502. @@ -363,7 +365,7 @@ HRESULT DeleteKeyTree( HKEY hkey, const char* pPath, REGSAM nKeyAccess ) RegCloseKey( hkey1 ),hkey1= NULL; // delete the key itself - return RegDeleteKeyExA( hkey, pPath, nKeyAccess & ( KEY_WOW64_64KEY | KEY_WOW64_32KEY ), 0 ); + return REG_DELETE_KEY_A( hkey, pPath, nKeyAccess & ( KEY_WOW64_64KEY | KEY_WOW64_32KEY ) ); } STDAPI DllUnregisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) diff --git a/extensions/source/nsplugin/source/nsplugin.rc b/extensions/source/nsplugin/source/nsplugin.rc index a97db09665e0..7d4b60b5bdad 100644 --- a/extensions/source/nsplugin/source/nsplugin.rc +++ b/extensions/source/nsplugin/source/nsplugin.rc @@ -26,5 +26,5 @@ ************************************************************************/ #define ADDITIONAL_VERINFO1 value "FileExtents", "sdc|sds|sda|sdd|sdp|smf|vor|sgl|sdw|sxc|stc|sxd|std|sxi|sti|sxm|sxw|sxg|stw|odt|ott|odm|oth|ods|ots|odg|otg|odp|otp|odf\0"\ value "FileOpenName", "StarCalc 3.0 - 5.0|StarChart 3.0 - 5.0|StarDraw 3.0 - 5.0|StarImpress 3.0 - 5.0|StarImpress-packed 3.0 - 5.0|StarMath 3.0 - 5.0|StarWriter Template 3.0 - 5.0|StarWriter Global 3.0 - 5.0|StarWriter 3.0 - 5.0|StarOffice 6.0/7 Spreadsheet|StarOffice 6.0/7 Spreadsheet Template|StarOffice 6.0/7 Drawing|StarOffice 6.0/7 Drawing Template|StarOffice 6.0/7 Presentation|StarOffice 6.0/7 Presentation Template|StarOffice 6.0/7 Formula|StarOffice 6.0/7 Text Document|StarOffice 6.0/7 Master Document|StarOffice 6.0/7 Text Document Template|OpenDocument Text|OpenDocument Text Template|OpenDocument Master Document|HTML Document Template|OpenDocument Spreadsheet|OpenDocument Spreadsheet Template|OpenDocument Drawing|OpenDocument Drawing Template|OpenDocument Presentation|OpenDocument Presentation Template|OpenDocument Formula\0" -#define ADDITIONAL_VERINFO2 value "FileDescription", "StarOffice/StarSuite Plug-in handles all its documents" value "ProductName", "StarOffice/StarSuite Plug-in" value "MIMEType", "application/vnd.stardivision.calc|application/vnd.stardivision.chart|application/vnd.stardivision.draw|application/vnd.stardivision.impress|application/vnd.stardivision.impress-packed|application/vnd.stardivision.math|application/vnd.stardivision.writer|application/vnd.stardivision.writer-global|application/vnd.staroffice.writer|application/vnd.sun.xml.calc|application/vnd.sun.xml.calc.template|application/vnd.sun.xml.draw|application/vnd.sun.xml.draw.template|" +#define ADDITIONAL_VERINFO2 value "FileDescription", "Oracle Open Office Plug-in handles all its documents" value "ProductName", "Oracle Open Office Plug-in" value "MIMEType", "application/vnd.stardivision.calc|application/vnd.stardivision.chart|application/vnd.stardivision.draw|application/vnd.stardivision.impress|application/vnd.stardivision.impress-packed|application/vnd.stardivision.math|application/vnd.stardivision.writer|application/vnd.stardivision.writer-global|application/vnd.staroffice.writer|application/vnd.sun.xml.calc|application/vnd.sun.xml.calc.template|application/vnd.sun.xml.draw|application/vnd.sun.xml.draw.template|" #define ADDITIONAL_VERINFO3 "application/vnd.sun.xml.impress|application/vnd.sun.xml.impress.template|application/vnd.sun.xml.math|application/vnd.sun.xml.writer|application/vnd.sun.xml.writer.global|application/vnd.sun.xml.writer.template|application/vnd.oasis.opendocument.text|application/vnd.oasis.opendocument.text-template|application/vnd.oasis.opendocument.text-master|application/vnd.oasis.opendocument.text-web|application/vnd.oasis.opendocument.spreadsheet|application/vnd.oasis.opendocument.spreadsheet-template|application/vnd.oasis.opendocument.graphics|application/vnd.oasis.opendocument.graphics-template|application/vnd.oasis.opendocument.presentation|application/vnd.oasis.opendocument.presentation-template|application/vnd.oasis.opendocument.formula\0" diff --git a/extensions/source/nsplugin/source/so_env.cxx b/extensions/source/nsplugin/source/so_env.cxx index 36a2b3f3abec..5e86da9726b9 100644 --- a/extensions/source/nsplugin/source/so_env.cxx +++ b/extensions/source/nsplugin/source/so_env.cxx @@ -31,6 +31,9 @@ #ifdef UNIX #include <sys/types.h> #include <strings.h> +#ifdef LINUX +#include <dlfcn.h> +#endif #include <stdarg.h> // For vsnprintf() #define NSP_vsnprintf vsnprintf @@ -119,6 +122,113 @@ restoreUTF8(char *pPath) return 0; } +#ifdef LINUX +extern int nspluginOOoModuleHook (void** aResult); +int nspluginOOoModuleHook (void** aResult) +{ + void *dl_handle; + + dl_handle = dlopen(NULL, RTLD_NOW); + if (!dl_handle) + { + fprintf (stderr, "Can't open myself '%s'\n", dlerror()); + return 1; + } + + Dl_info dl_info = { 0,0,0,0 }; + if(!dladdr((void *)nspluginOOoModuleHook, &dl_info)) + { + fprintf (stderr, "Can't find my own address '%s'\n", dlerror()); + return 1; + } + + if (!dl_info.dli_fname) + { + fprintf (stderr, "Can't find my own file name\n"); + return 1; + } + + char cwdstr[NPP_PATH_MAX]; + if (!getcwd (cwdstr, sizeof(cwdstr))) + { + fprintf (stderr, "Can't get cwd\n"); + return 1; + } + + char libFileName[NPP_PATH_MAX]; + + if (dl_info.dli_fname[0] != '/') + { + if ((strlen(cwdstr) + 1 + strlen(dl_info.dli_fname)) >= NPP_PATH_MAX) + { + fprintf (stderr, "Plugin path too long\n"); + return 1; + } + strcpy (libFileName, cwdstr); + strcat (libFileName, "/"); + strcat (libFileName, dl_info.dli_fname); + } + else + { + if (strlen(dl_info.dli_fname) >= NPP_PATH_MAX) + { + fprintf (stderr, "Plugin path too long\n"); + return 1; + } + strcpy (libFileName, dl_info.dli_fname); + } + + char *clobber; + static char realFileName[NPP_PATH_MAX] = {0}; +# define SEARCH_SUFFIX "/program/libnpsoplug" + + if (!(clobber = strstr (libFileName, SEARCH_SUFFIX))) + { + ssize_t len = readlink(libFileName, realFileName, NPP_PATH_MAX-1); + if (len == -1) + { + fprintf (stderr, "Couldn't read link '%s'\n", libFileName); + return 1; + } + realFileName[len] = '\0'; + if (!(clobber = strstr (realFileName, SEARCH_SUFFIX))) + { + fprintf (stderr, "Couldn't find suffix in '%s'\n", realFileName); + return 1; + } + *clobber = '\0'; + } + else + { + *clobber = '\0'; + strcpy (realFileName, libFileName); + } + + fprintf (stderr, "OpenOffice path before fixup is '%s'\n", realFileName); + + if (realFileName[0] != '/') { + /* a relative sym-link and we need to get an absolute path */ + char scratch[NPP_PATH_MAX] = {0}; + if (strlen (realFileName) + strlen (libFileName) + 2 >= NPP_PATH_MAX - 1) + { + fprintf (stderr, "Paths too long to fix up.\n"); + return 1; + } + strcpy (scratch, libFileName); + if (strrchr (scratch, '/')) /* remove the last element */ + *(strrchr (scratch, '/') + 1) = '\0'; + strcat (scratch, realFileName); + strcpy (realFileName, scratch); + } + + *aResult = realFileName; + + fprintf (stderr, "OpenOffice path is '%s'\n", realFileName); + + return 0; +} +#endif + // *aResult points the static string holding "/opt/staroffice8" int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const char* /*entry*/) { @@ -131,9 +241,29 @@ int findReadSversion(void** aResult, int /*bWnt*/, const char* /*tag*/, const ch // Filename of lnk file, eg. "soffice" char lnkFileName[NPP_PATH_MAX] = {0}; char* pTempZero = NULL; + +#ifdef LINUX + /* try to fetch a 'self' pointer */ + if (!nspluginOOoModuleHook (aResult)) + return 0; + + /* .. now in $HOME */ +#endif sprintf(lnkFileName, "%s/.mozilla/plugins/libnpsoplugin%s", getenv("HOME"), SAL_DLLEXTENSION); +#ifdef LINUX + ssize_t len = readlink(lnkFileName, realFileName, NPP_PATH_MAX-1); + if (-1 == len) + { + *realFileName = 0; + return -1; + } + realFileName[len] = '\0'; + + if (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION))) +#else if ((0 > readlink(lnkFileName, realFileName, NPP_PATH_MAX)) || - (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION)))) + (NULL == (pTempZero = strstr(realFileName, "/program/libnpsoplugin" SAL_DLLEXTENSION)))) +#endif { *realFileName = 0; return -1; @@ -210,27 +340,6 @@ const char* findProgramDir() return sProgram; } -// Return: "/home/build/staroffice/program" + original system library path -const char* getNewLibraryPath() -{ - static char pLPATH[NPP_PATH_MAX*4] = {0}; - - if (!pLPATH[0]) - { - const char* pProgram = findProgramDir(); - strcpy(pLPATH, "LD_LIBRARY_PATH="); - strcat(pLPATH, pProgram); - - char* pLD = getenv("LD_LIBRARY_PATH"); - if (pLD) - { - strcat(pLPATH, ":"); - strcat(pLPATH, pLD); - } - } - return pLPATH; -} - #ifdef WNT // Return SO executable absolute path, like "/home/build/staroffice/program/soffice" const char* findSofficeExecutable() diff --git a/extensions/source/nsplugin/source/so_env.hxx b/extensions/source/nsplugin/source/so_env.hxx index a4e98a878f2a..0cf1194c2dc2 100644 --- a/extensions/source/nsplugin/source/so_env.hxx +++ b/extensions/source/nsplugin/source/so_env.hxx @@ -69,9 +69,6 @@ // return the install path of staroffice, return value like "/home/build/staroffice" const char* findInstallDir(); -// return original system library path + "/home/build/staroffice/program" -const char* getNewLibraryPath(); - // return SO program dir absolute path, like "/home/build/staroffice/program" const char* findProgramDir(); diff --git a/extensions/source/nsplugin/source/so_instance.cxx b/extensions/source/nsplugin/source/so_instance.cxx index 65e511dfcc35..4b1e41f724bd 100644 --- a/extensions/source/nsplugin/source/so_instance.cxx +++ b/extensions/source/nsplugin/source/so_instance.cxx @@ -366,14 +366,6 @@ sal_Bool SoPluginInstance::LoadDocument(NSP_HWND hParent) return sal_True; } -sal_Bool SoPluginInstance::SetSODir(char * sDir) -{ - if(strlen(sDir) >= NPP_PATH_MAX) return sal_False; - - strcpy(sSO_Dir, sDir); - return sal_True; -} - sal_Bool SoPluginInstance::SetWindow(NSP_HWND hParent, int x, int y, int w, int h) { sal_Bool bRetval(sal_True); diff --git a/extensions/source/nsplugin/source/so_instance.hxx b/extensions/source/nsplugin/source/so_instance.hxx index 17266fcefc71..e95bb7c024ec 100644 --- a/extensions/source/nsplugin/source/so_instance.hxx +++ b/extensions/source/nsplugin/source/so_instance.hxx @@ -103,7 +103,6 @@ public: virtual sal_Bool Print(void) ; static sal_Bool ShutDown(void); - static sal_Bool SetSODir(char * sDir); static char* GetSODir(void) {return sSO_Dir;}; long GetParent(void) {return m_pParent;}; }; diff --git a/extensions/source/nsplugin/source/so_main.cxx b/extensions/source/nsplugin/source/so_main.cxx index 7932f63d6d4d..49c899994424 100644 --- a/extensions/source/nsplugin/source/so_main.cxx +++ b/extensions/source/nsplugin/source/so_main.cxx @@ -126,7 +126,7 @@ int find_free_node() return -1; } -int find_cur_node(sal_Int32 cur_id) +int find_cur_node(long cur_id) { for(int i=0; i<MAX_NODE_NUM; i++) { @@ -148,16 +148,6 @@ sal_Bool dump_plugin_message(PLUGIN_MSG* pMsg) return sal_True; } -int prepareEnviron() -{ - // if child process inherit the chdir() property from parent process, if yes, no getNewLibraryPath() needed - const char* pNewLibraryPath = getNewLibraryPath(); - putenv( (char*) pNewLibraryPath ); - SoPluginInstance::SetSODir((char *)findProgramDir()); - - return 0; -} - int Set_Window(PLUGIN_MSG* pMsg) { dump_plugin_message(pMsg); diff --git a/extensions/source/ole/oleobjw.cxx b/extensions/source/ole/oleobjw.cxx index 79baf3c7d8df..ea9377ccf596 100644 --- a/extensions/source/ole/oleobjw.cxx +++ b/extensions/source/ole/oleobjw.cxx @@ -422,6 +422,46 @@ Any SAL_CALL IUnknownWrapper_Impl::getValue( const OUString& aPropertyName ) { o2u_attachCurrentThread(); ITypeInfo * pInfo = getTypeInfo(); + // I was going to implement an XServiceInfo interface to allow the type + // of the automation object to be exposed.. but it seems + // from looking at comments in the code that it is possible for + // this object to actually wrap an UNO object ( I guess if automation is + // used from MSO to create Openoffice objects ) Therefore, those objects + // will more than likely already have their own XServiceInfo interface. + // Instead here I chose a name that should be illegal both in COM and + // UNO ( from an IDL point of view ) therefore I think this is a safe + // hack + if ( aPropertyName.equals( rtl::OUString::createFromAscii("$GetTypeName") )) + { + if ( pInfo && m_sTypeName.getLength() == 0 ) + { + m_sTypeName = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("IDispatch") ); + CComBSTR sName; + + if ( SUCCEEDED( pInfo->GetDocumentation( -1, &sName, NULL, NULL, NULL ) ) ) + { + rtl::OUString sTmp( reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName))); + if ( sTmp.indexOf('_') == 0 ) + sTmp = sTmp.copy(1); + // do we own the memory for pTypeLib, msdn doco is vague + // I'll assume we do + CComPtr< ITypeLib > pTypeLib; + unsigned int index; + if ( SUCCEEDED( pInfo->GetContainingTypeLib( &pTypeLib.p, &index )) ) + { + if ( SUCCEEDED( pTypeLib->GetDocumentation( -1, &sName, NULL, NULL, NULL ) ) ) + { + rtl::OUString sLibName( reinterpret_cast<const sal_Unicode*>(LPCOLESTR(sName))); + m_sTypeName = sLibName.concat( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(".") ) ).concat( sTmp ); + + } + } + } + + } + ret <<= m_sTypeName; + return ret; + } FuncDesc aDescGet(pInfo); FuncDesc aDescPut(pInfo); VarDesc aVarDesc(pInfo); diff --git a/extensions/source/ole/oleobjw.hxx b/extensions/source/ole/oleobjw.hxx index 6d46452eb088..230de2b7dcf8 100644 --- a/extensions/source/ole/oleobjw.hxx +++ b/extensions/source/ole/oleobjw.hxx @@ -234,6 +234,7 @@ protected: Sequence<Type> m_seqTypes; CComPtr<IUnknown> m_spUnknown; CComPtr<IDispatch> m_spDispatch; + rtl::OUString m_sTypeName; // is "" ( not initialised ), "IDispatch" ( we have no idea ) or "SomeLibrary.SomeTypeName" if we managed to get a type /** This value is set dureing XInitialization::initialize. It indicates that the COM interface was transported as VT_DISPATCH in a VARIANT rather then a VT_UNKNOWN */ diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index 71a0bb2db3ce..108333076e19 100644 --- a/extensions/source/propctrlr/browserline.cxx +++ b/extensions/source/propctrlr/browserline.cxx @@ -320,12 +320,6 @@ namespace pcr } //------------------------------------------------------------------ - sal_Bool OBrowserLine::IsPropertyInputEnabled( ) const - { - return ( m_nEnableFlags & PropertyLineElement::InputControl ) != 0; - } - - //------------------------------------------------------------------ void OBrowserLine::SetReadOnly( bool _bReadOnly ) { if ( m_bReadOnly != _bReadOnly ) diff --git a/extensions/source/propctrlr/browserline.hxx b/extensions/source/propctrlr/browserline.hxx index db747b4a6b99..7848b387d608 100644 --- a/extensions/source/propctrlr/browserline.hxx +++ b/extensions/source/propctrlr/browserline.hxx @@ -115,7 +115,6 @@ namespace pcr void EnablePropertyControls( sal_Int16 _nControls, bool _bEnable ); void EnablePropertyLine( bool _bEnable ); - sal_Bool IsPropertyInputEnabled( ) const; void SetReadOnly( bool _bReadOnly ); diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 67257f960f5b..8a2885fc8c69 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -682,16 +682,6 @@ namespace pcr } //------------------------------------------------------------------------ - Any OBrowserListBox::GetPropertyValue( const ::rtl::OUString& _rEntryName ) const - { - Any aValue; - ListBoxLines::const_iterator line = m_aLines.find( _rEntryName ); - if ( line != m_aLines.end() ) - aValue = impl_getControlAsPropertyValue( line->second ); - return aValue; - } - - //------------------------------------------------------------------------ sal_uInt16 OBrowserListBox::GetPropertyPos( const ::rtl::OUString& _rEntryName ) const { sal_uInt16 nRet = LISTBOX_ENTRY_NOTFOUND; @@ -722,15 +712,6 @@ namespace pcr } //------------------------------------------------------------------------ - sal_Bool OBrowserListBox::IsPropertyInputEnabled( const ::rtl::OUString& _rEntryName ) const - { - BrowserLinePointer pLine; - if ( impl_getBrowserLineForName( _rEntryName, pLine ) ) - return pLine->IsPropertyInputEnabled(); - return sal_False; - } - - //------------------------------------------------------------------------ void OBrowserListBox::EnablePropertyControls( const ::rtl::OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable ) { BrowserLinePointer pLine; diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index de0ebc9dd6b6..edd9d9bd40eb 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -163,13 +163,11 @@ namespace pcr void ChangeEntry( const OLineDescriptor&, sal_uInt16 nPos ); void SetPropertyValue( const ::rtl::OUString& rEntryName, const ::com::sun::star::uno::Any& rValue, bool _bUnknownValue ); - ::com::sun::star::uno::Any GetPropertyValue( const ::rtl::OUString& rEntryName ) const; sal_uInt16 GetPropertyPos( const ::rtl::OUString& rEntryName ) const; ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > GetPropertyControl( const ::rtl::OUString& rEntryName ); void EnablePropertyControls( const ::rtl::OUString& _rEntryName, sal_Int16 _nControls, bool _bEnable ); void EnablePropertyLine( const ::rtl::OUString& _rEntryName, bool _bEnable ); - sal_Bool IsPropertyInputEnabled( const ::rtl::OUString& _rEntryName ) const; sal_Int32 GetMinimumWidth(); sal_Int32 GetMinimumHeight(); diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx index 0e82397dae2c..ae87a85a3722 100644 --- a/extensions/source/propctrlr/handlerhelper.cxx +++ b/extensions/source/propctrlr/handlerhelper.cxx @@ -161,14 +161,6 @@ namespace pcr //-------------------------------------------------------------------- Reference< XPropertyControl > PropertyHandlerHelper::createListBoxControl( const Reference< XPropertyControlFactory >& _rxControlFactory, - const Sequence< ::rtl::OUString >& _rInitialListEntries, sal_Bool _bReadOnlyControl, sal_Bool _bSorted ) - { - ::std::vector< ::rtl::OUString > aAsVector( _rInitialListEntries.getConstArray(), _rInitialListEntries.getConstArray() + _rInitialListEntries.getLength() ); - return lcl_implCreateListLikeControl( _rxControlFactory, aAsVector, _bReadOnlyControl, _bSorted, sal_True ); - } - - //-------------------------------------------------------------------- - Reference< XPropertyControl > PropertyHandlerHelper::createListBoxControl( const Reference< XPropertyControlFactory >& _rxControlFactory, const ::std::vector< ::rtl::OUString >& _rInitialListEntries, sal_Bool _bReadOnlyControl, sal_Bool _bSorted ) { return lcl_implCreateListLikeControl( _rxControlFactory, _rInitialListEntries, _bReadOnlyControl, _bSorted, sal_True ); diff --git a/extensions/source/propctrlr/handlerhelper.hxx b/extensions/source/propctrlr/handlerhelper.hxx index bf42c5555f1b..e55cbf207526 100644 --- a/extensions/source/propctrlr/handlerhelper.hxx +++ b/extensions/source/propctrlr/handlerhelper.hxx @@ -105,14 +105,6 @@ namespace pcr static ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > createListBoxControl( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory, - const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rInitialListEntries, - sal_Bool _bReadOnlyControl, - sal_Bool _bSorted - ); - - static ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl > - createListBoxControl( - const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory, const ::std::vector< ::rtl::OUString >& _rInitialListEntries, sal_Bool _bReadOnlyControl, sal_Bool _bSorted diff --git a/forms/prj/build.lst b/forms/prj/build.lst index 99f6b29d208b..cc71868b734d 100644 --- a/forms/prj/build.lst +++ b/forms/prj/build.lst @@ -1,4 +1,4 @@ -fm forms : l10n oovbaapi svx sfx2 QADEVOOO:qadevOOo NULL +fm forms : l10n oovbaapi svx sfx2 qadevOOo NULL fm forms usr1 - all fm_mkofrm NULL fm forms\inc nmake - all fm_inc NULL fm forms\source\inc get - all fm_sinc NULL diff --git a/forms/qa/makefile.mk b/forms/qa/makefile.mk index 1f12a8cf4a74..afafcca427aa 100644 --- a/forms/qa/makefile.mk +++ b/forms/qa/makefile.mk @@ -32,8 +32,6 @@ PRJNAME = forms # --- Settings ----------------------------------------------------- .INCLUDE: settings.mk - -.IF "$(BUILD_QADEVOOO)" == "YES" #----- compile .java files ----------------------------------------- JARFILES = ridl.jar unoil.jar jurt.jar juh.jar java_uno.jar OOoRunner.jar ConnectivityTools.jar @@ -54,7 +52,6 @@ JARCOMPRESS = TRUE # classpath and argument list RUNNER_CLASSPATH = -cp "$(CLASSPATH)$(PATH_SEPERATOR)$(SOLARBINDIR)$/OOoRunner.jar$(PATH_SEPERATOR)$(SOLARBINDIR)$/ConnectivityTools.jar" RUNNER_ARGS = org.openoffice.Runner -TestBase java_complex -.END # --- Targets ------------------------------------------------------ @@ -72,7 +69,6 @@ ALL: ALLDEP test: echo $(SOLARBINDIR) -.IF "$(BUILD_QADEVOOO)" == "YES" show_targets: +@$(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) complexlib.ShowTargets $(foreach,i,$(JAVAFILES) $(i:s/.\$///:s/.java//)) @@ -81,11 +77,3 @@ run: run_%: +$(COPY) integration$/forms$/*.props $(CLASSDIR)$/$(PACKAGE) && $(AUGMENT_LIBRARY_PATH) java $(RUNNER_CLASSPATH) $(RUNNER_ARGS) -o integration.$(PRJNAME).$(@:s/run_//) - -.ELSE -run: show_targets - -show_targets: - +@echo "Built without qadevOOo, no QA tests" - -.ENDIF diff --git a/forms/qa/unoapi/forms.sce b/forms/qa/unoapi/forms.sce index 97e9c7422f35..073472f03126 100644 --- a/forms/qa/unoapi/forms.sce +++ b/forms/qa/unoapi/forms.sce @@ -1,5 +1,5 @@ -o forms.OButtonControl --o forms.OButtonModel +#i111285 -o forms.OButtonModel -o forms.OCheckBoxControl -o forms.OCheckBoxModel -o forms.OComboBoxControl @@ -11,10 +11,10 @@ -o forms.ODateModel -o forms.OEditControl -o forms.OEditModel --o forms.OFileControlModel +#i109939 -o forms.OFileControlModel -o forms.OFixedTextModel -o forms.OFormattedControl --o forms.OFormattedFieldWrapper +#i109939 -o forms.OFormattedFieldWrapper # LSST EIN DOKUMENT OFFEN -o forms.OFormsCollection -o forms.OGridControlModel -o forms.OGroupBoxControl diff --git a/forms/qa/unoapi/knownissues.xcl b/forms/qa/unoapi/knownissues.xcl index 1cec8ac106a2..2e10a269c681 100644 --- a/forms/qa/unoapi/knownissues.xcl +++ b/forms/qa/unoapi/knownissues.xcl @@ -116,3 +116,14 @@ forms.OListBoxModel::com::sun::star::form::XUpdateBroadcaster forms.OFormattedFieldWrapper::com::sun::star::form::XUpdateBroadcaster forms.ODateModel::com::sun::star::form::XUpdateBroadcaster forms.OComboBoxModel::com::sun::star::form::XUpdateBroadcaster + +### i111006 ### +forms.OFileControlModel::com::sun::star::beans::XFastPropertySet +forms.OFileControlModel::com::sun::star::form::FormControlModel + +### i111148 ### +forms.OImageControlModel::com::sun::star::beans::XMultiPropertySet +forms.OImageControlModel::com::sun::star::beans::XPropertySet + +### i111333 ### +forms.OImageControlControl::com::sun::star::awt::XControl diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 5f3f04d45618..154ed4b00272 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -2403,6 +2403,7 @@ void ODatabaseForm::_propertyChanged(const PropertyChangeEvent& evt) throw( Runt //------------------------------------------------------------------------------ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException) { + // SYNCHRONIZED -----> ::osl::ResettableMutexGuard aGuard(m_aMutex); Reference<XForm> xParentForm(getParent(), UNO_QUERY); @@ -2447,14 +2448,15 @@ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com } } + Reference< XPropertySet > xAggregateProperties( m_xAggregateSet ); + aGuard.clear(); + // <----- SYNCHRONIZED + Reference< XConnection > xOuterConnection; sal_Bool bIsEmbedded = ::dbtools::isEmbeddedInDatabase( Parent, xOuterConnection ); - // clear the guard before setting property values, because of the notifications - // which are triggered there - aGuard.clear(); if ( bIsEmbedded ) - m_xAggregateSet->setPropertyValue( PROPERTY_DATASOURCE, makeAny( ::rtl::OUString() ) ); + xAggregateProperties->setPropertyValue( PROPERTY_DATASOURCE, makeAny( ::rtl::OUString() ) ); } //============================================================================== diff --git a/forms/source/inc/InterfaceContainer.hxx b/forms/source/inc/InterfaceContainer.hxx index 427d0c6ed190..90e508f43ca8 100644 --- a/forms/source/inc/InterfaceContainer.hxx +++ b/forms/source/inc/InterfaceContainer.hxx @@ -273,7 +273,7 @@ protected: private: // hack for Vba Events - void fakeVbaEventsHack( sal_Int32 _nIndex ); + void impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIndex ); // the runtime event format has changed from version SO5.2 to OOo enum EventFormat diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx index b594df158d17..e494406f87ef 100644 --- a/forms/source/misc/InterfaceContainer.cxx +++ b/forms/source/misc/InterfaceContainer.cxx @@ -31,6 +31,7 @@ #include "frm_resource.hrc" #include "frm_resource.hxx" #include "InterfaceContainer.hxx" +#include "componenttools.hxx" #include "property.hrc" #include "services.hxx" @@ -40,6 +41,7 @@ #include <com/sun/star/io/XMarkableStream.hpp> #include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/form/XForm.hpp> #include <comphelper/container.hxx> #include <comphelper/enumhelper.hxx> @@ -119,54 +121,52 @@ lcl_stripVbaEvents( const Sequence< ScriptEventDescriptor >& sEvents ) return sStripped; } -void -OInterfaceContainer::fakeVbaEventsHack( sal_Int32 _nIndex ) +void OInterfaceContainer::impl_addVbEvents_nolck_nothrow( const sal_Int32 i_nIndex ) { // we are dealing with form controls try { - Reference< XFormComponent > xForm( static_cast< XContainer* >(this), UNO_QUERY_THROW ); - // grand-parent should be the model, no parent ? if not - // we'll ignore, we'll get called back here anyway ) - Reference< XChild > xChild( xForm->getParent(), UNO_QUERY_THROW ); - Reference< XModel > xDocOwner( xChild->getParent(), UNO_QUERY ); - OSL_TRACE(" Is DOC ????? %s", xDocOwner.is() ? "true" : "false" ); - if ( xDocOwner.is() ) + do { - bool hasVBABindings = lcl_hasVbaEvents( m_xEventAttacher->getScriptEvents( _nIndex ) ); + Reference< XModel > xDoc( getXModel( static_cast< XContainer *> ( this ) ) ); + if ( !xDoc.is() ) + break; + + Reference< XMultiServiceFactory > xDocFac( xDoc, UNO_QUERY_THROW ); + Reference< XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBACodeNameProvider" ) ), UNO_QUERY ); + if ( !xNameQuery.is() ) + break; + + ::osl::MutexGuard aGuard( m_rMutex ); + bool hasVBABindings = lcl_hasVbaEvents( m_xEventAttacher->getScriptEvents( i_nIndex ) ); if ( hasVBABindings ) - { - OSL_TRACE("Has VBA bindings already, returning "); - return; - } - Reference< XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory(), UNO_QUERY ); - Reference< XMultiServiceFactory > xDocFac( xDocOwner, UNO_QUERY ); - if ( xFac.is() && xDocFac.is() ) - { - try - { - Reference< ooo::vba::XVBAToOOEventDescGen > xDescSupplier( xFac->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBAToOOEventDesc" ) ), UNO_QUERY_THROW ); - Reference< XInterface > xIf( getByIndex( _nIndex ) , UNO_QUERY_THROW ); - Reference< XCodeNameQuery > xNameQuery( xDocFac->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBACodeNameProvider" ) ), UNO_QUERY_THROW ); - - rtl::OUString sCodeName; - sCodeName = xNameQuery->getCodeNameForObject( xIf ); - Reference< XPropertySet > xProps( xIf, UNO_QUERY ); - rtl::OUString sServiceName; - xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName; - - Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( xFac->createInstance( sServiceName ), sCodeName ); - // register the vba script events - if ( m_xEventAttacher.is() ) - m_xEventAttacher->registerScriptEvents( _nIndex, vbaEvents ); - } - catch( Exception& ){ OSL_TRACE("lcl_fakevbaevents - Caught Exception trying to create control eventstuff "); } - } + break; + + Reference< XInterface > xElement( getByIndex( i_nIndex ) , UNO_QUERY_THROW ); + Reference< XForm > xElementAsForm( xElement, UNO_QUERY ); + if ( xElementAsForm.is() ) + break; + ::rtl::OUString sCodeName( xNameQuery->getCodeNameForObject( xElement ) ); + + Reference< XPropertySet > xProps( xElement, UNO_QUERY_THROW ); + ::rtl::OUString sServiceName; + xProps->getPropertyValue( rtl::OUString::createFromAscii("DefaultControl" ) ) >>= sServiceName; + + Reference< ooo::vba::XVBAToOOEventDescGen > xDescSupplier( m_xServiceFactory->createInstance( rtl::OUString::createFromAscii( "ooo.vba.VBAToOOEventDesc" ) ), UNO_QUERY_THROW ); + Sequence< ScriptEventDescriptor > vbaEvents = xDescSupplier->getEventDescriptions( m_xServiceFactory->createInstance( sServiceName ), sCodeName ); + // register the vba script events + m_xEventAttacher->registerScriptEvents( i_nIndex, vbaEvents ); } + while ( false ); + } + catch ( const ServiceNotRegisteredException& ) + { + // silence this, not all document types support the ooo.vba.VBACodeNameProvider service } - catch( Exception& ) + catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } @@ -827,8 +827,9 @@ void OInterfaceContainer::approveNewElement( const Reference< XPropertySet >& _r void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XPropertySet >& _rxElement, sal_Bool _bEvents, ElementDescription* _pApprovalResult, sal_Bool _bFire ) throw( IllegalArgumentException ) { - RTL_LOGFILE_CONTEXT( aLogger, "forms::OInterfaceContainer::implInsert" ); + const bool bHandleEvents = _bEvents && m_xEventAttacher.is(); + // SYNCHRONIZED -----> ::osl::ClearableMutexGuard aGuard( m_rMutex ); ::std::auto_ptr< ElementDescription > aAutoDeleteMetaData; @@ -866,17 +867,24 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper m_aMap.insert( ::std::pair< const ::rtl::OUString, InterfaceRef >( sName, pElementMetaData->xInterface ) ); // announce ourself as parent to the new element - { - RTL_LOGFILE_CONTEXT( aLogger, "forms::OInterfaceContainer::implInsert::settingParent" ); - pElementMetaData->xChild->setParent(static_cast<XContainer*>(this)); - } + pElementMetaData->xChild->setParent(static_cast<XContainer*>(this)); // handle the events - if ( _bEvents && m_xEventAttacher.is() ) + if ( bHandleEvents ) { m_xEventAttacher->insertEntry(_nIndex); m_xEventAttacher->attach( _nIndex, pElementMetaData->xInterface, makeAny( _rxElement ) ); - // insert fake events? + } + + // notify derived classes + implInserted( pElementMetaData ); + + aGuard.clear(); + // <----- SYNCHRONIZED + + // insert faked VBA events? + if ( bHandleEvents ) + { Reference< XEventAttacherManager > xMgr ( pElementMetaData->xInterface, UNO_QUERY ); if ( xMgr.is() ) { @@ -885,19 +893,16 @@ void OInterfaceContainer::implInsert(sal_Int32 _nIndex, const Reference< XProper for ( sal_Int32 i = 0; (i < nLen) && pIfcMgr ; ++i ) { // add fake events to the control at index i - pIfcMgr->fakeVbaEventsHack( i ); + pIfcMgr->impl_addVbEvents_nolck_nothrow( i ); } } else { // add fake events to the control at index i - fakeVbaEventsHack( _nIndex ); + impl_addVbEvents_nolck_nothrow( _nIndex ); } } - // notify derived classes - implInserted( pElementMetaData ); - // fire the notification about the change if ( _bFire ) { @@ -1187,29 +1192,30 @@ void SAL_CALL OInterfaceContainer::removeByName(const ::rtl::OUString& Name) thr //------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::registerScriptEvent( sal_Int32 nIndex, const ScriptEventDescriptor& aScriptEvent ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("*** registerScriptEvent %d", nIndex); + ::osl::ClearableMutexGuard aGuard( m_rMutex ); if ( m_xEventAttacher.is() ) { m_xEventAttacher->registerScriptEvent( nIndex, aScriptEvent ); - fakeVbaEventsHack( nIndex ); // add fake vba events + aGuard.clear(); + impl_addVbEvents_nolck_nothrow( nIndex ); // add fake vba events } } //------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::registerScriptEvents( sal_Int32 nIndex, const Sequence< ScriptEventDescriptor >& aScriptEvents ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("*** registerScriptEvent(s) %d", nIndex); + ::osl::ClearableMutexGuard aGuard( m_rMutex ); if ( m_xEventAttacher.is() ) { m_xEventAttacher->registerScriptEvents( nIndex, aScriptEvents ); - fakeVbaEventsHack( nIndex ); // add fake vba events + aGuard.clear(); + impl_addVbEvents_nolck_nothrow( nIndex ); // add fake vba events } } //------------------------------------------------------------------------ void SAL_CALL OInterfaceContainer::revokeScriptEvent( sal_Int32 nIndex, const ::rtl::OUString& aListenerType, const ::rtl::OUString& aEventMethod, const ::rtl::OUString& aRemoveListenerParam ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("*** revokeScriptEvent %d listenertype %s, eventMethod %s", nIndex, rtl::OUStringToOString( aListenerType, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aEventMethod, RTL_TEXTENCODING_UTF8 ).getStr()); if ( m_xEventAttacher.is() ) m_xEventAttacher->revokeScriptEvent( nIndex, aListenerType, aEventMethod, aRemoveListenerParam ); } @@ -1238,7 +1244,6 @@ void SAL_CALL OInterfaceContainer::removeEntry( sal_Int32 nIndex ) throw(Illegal //------------------------------------------------------------------------ Sequence< ScriptEventDescriptor > SAL_CALL OInterfaceContainer::getScriptEvents( sal_Int32 nIndex ) throw(IllegalArgumentException, RuntimeException) { - OSL_TRACE("getScriptEvents"); Sequence< ScriptEventDescriptor > aReturn; if ( m_xEventAttacher.is() ) { diff --git a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java index ccc1e7bf11df..ad3460159262 100755 --- a/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java +++ b/javainstaller2/src/JavaSetup/org/openoffice/setup/InstallerHelper/SolarisHelper.java @@ -120,8 +120,8 @@ public class SolarisHelper { String mailLine = "mail="; adminFile.add(mailLine); - String conflictLine = "conflict=quit"; - if ( data.isUserInstallation() ) { conflictLine = "conflict=nocheck"; } + String conflictLine = "conflict=nochange"; + if ( data.isUserInstallation() ) { conflictLine = "conflict=nochange"; } adminFile.add(conflictLine); String runlevelLine = "runlevel=nocheck"; diff --git a/package/inc/PackageConstants.hxx b/package/inc/PackageConstants.hxx index e088dceef126..a23a22fcb888 100644 --- a/package/inc/PackageConstants.hxx +++ b/package/inc/PackageConstants.hxx @@ -33,10 +33,6 @@ const sal_Int32 n_ConstBufferSize = 32768; const sal_Int32 n_ConstMaxMemoryStreamSize = 20480; const sal_Int32 n_ConstDigestLength = 1024; -#define PACKAGE_FORMAT 1 -#define ZIP_FORMAT 2 -#define OFOPXML_FORMAT 3 - // the constants related to the manifest.xml entries #define PKG_MNFST_MEDIATYPE 0 #define PKG_MNFST_VERSION 1 diff --git a/package/inc/ZipPackage.hxx b/package/inc/ZipPackage.hxx index 367bd1d80de5..e3b8d44be183 100644 --- a/package/inc/ZipPackage.hxx +++ b/package/inc/ZipPackage.hxx @@ -93,7 +93,7 @@ protected: sal_Bool m_bForceRecovery; sal_Bool m_bMediaTypeFallbackUsed; - sal_Int16 m_nFormat; + sal_Int32 m_nFormat; sal_Bool m_bAllowRemoveOnInsert; InitialisationMode m_eMode; @@ -125,7 +125,7 @@ public: virtual ~ZipPackage( void ); ZipFile& getZipFile() { return *m_pZipFile;} const com::sun::star::uno::Sequence < sal_Int8 > & getEncryptionKey ( ) {return m_aEncryptionKey;} - sal_Int16 getFormat() const { return m_nFormat; } + sal_Int32 getFormat() const { return m_nFormat; } SotMutexHolderRef GetSharedMutexRef() { return m_aMutexHolder; } diff --git a/package/inc/ZipPackageFolder.hxx b/package/inc/ZipPackageFolder.hxx index 85823ba97c2c..89414f18ce65 100644 --- a/package/inc/ZipPackageFolder.hxx +++ b/package/inc/ZipPackageFolder.hxx @@ -58,13 +58,13 @@ class ZipPackageFolder : public cppu::ImplInheritanceHelper2 protected: ContentHash maContents; const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory > m_xFactory; - sal_Int16 m_nFormat; + sal_Int32 m_nFormat; ::rtl::OUString m_sVersion; public: ZipPackageFolder( const ::com::sun::star::uno::Reference < com::sun::star::lang::XMultiServiceFactory >& xFactory, - sal_Int16 nFormat, + sal_Int32 nFormat, sal_Bool bAllowRemoveOnInsert ); virtual ~ZipPackageFolder(); @@ -87,7 +87,7 @@ public: return aImplementationId; } - void setPackageFormat_Impl( sal_Int16 nFormat ) { m_nFormat = nFormat; } + void setPackageFormat_Impl( sal_Int32 nFormat ) { m_nFormat = nFormat; } void setRemoveOnInsertMode_Impl( sal_Bool bRemove ) { this->mbAllowRemoveOnInsert = bRemove; } // Recursive functions diff --git a/package/source/xstor/ocompinstream.cxx b/package/source/xstor/ocompinstream.cxx index 45bf7c01eb2f..fcb118f4b967 100644 --- a/package/source/xstor/ocompinstream.cxx +++ b/package/source/xstor/ocompinstream.cxx @@ -29,6 +29,7 @@ #include "precompiled_package.hxx" #include "ocompinstream.hxx" +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <osl/diagnose.h> @@ -41,7 +42,7 @@ using namespace ::com::sun::star; OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( &aImpl ) , m_rMutexRef( m_pImpl->m_rMutexRef ) , m_xStream( xStream ) @@ -60,7 +61,7 @@ OInputCompStream::OInputCompStream( OWriteStream_Impl& aImpl, //----------------------------------------------- OInputCompStream::OInputCompStream( uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( NULL ) , m_rMutexRef( new SotMutexHolder ) , m_xStream( xStream ) @@ -107,7 +108,7 @@ uno::Any SAL_CALL OInputCompStream::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -356,7 +357,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); try @@ -384,7 +385,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -409,7 +410,7 @@ sal_Bool SAL_CALL OInputCompStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -434,7 +435,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OInputCompStream::getRelationshipByI throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); // TODO/LATER: in future the unification of the ID could be checked @@ -464,7 +465,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -499,7 +500,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OInputCompStream::g throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); // TODO/LATER: in future the information could be taken directly from m_pImpl when possible @@ -530,7 +531,7 @@ void SAL_CALL OInputCompStream::insertRelationshipByID( const ::rtl::OUString& throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied @@ -550,7 +551,7 @@ void SAL_CALL OInputCompStream::removeRelationshipByID( const ::rtl::OUString& throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied @@ -570,7 +571,7 @@ void SAL_CALL OInputCompStream::insertRelationships( const uno::Sequence< uno:: throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied @@ -589,7 +590,7 @@ void SAL_CALL OInputCompStream::clearRelationships() throw lang::DisposedException(); } - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); throw io::IOException(); // TODO: Access denied diff --git a/package/source/xstor/ocompinstream.hxx b/package/source/xstor/ocompinstream.hxx index 047c8dc90758..fcb472e3f92a 100644 --- a/package/source/xstor/ocompinstream.hxx +++ b/package/source/xstor/ocompinstream.hxx @@ -60,17 +60,17 @@ protected: sal_Bool m_bDisposed; - sal_Int16 m_nStorageType; + sal_Int32 m_nStorageType; public: OInputCompStream( OWriteStream_Impl& pImpl, ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OInputCompStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); virtual ~OInputCompStream(); diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx index 6419889d9d11..0cd3f595c2b3 100644 --- a/package/source/xstor/oseekinstream.cxx +++ b/package/source/xstor/oseekinstream.cxx @@ -39,7 +39,7 @@ using namespace ::com::sun::star; OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl, uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : OInputCompStream( pImpl, xStream, aProps, nStorageType ) { if ( m_xStream.is() ) @@ -51,7 +51,7 @@ OInputSeekStream::OInputSeekStream( OWriteStream_Impl& pImpl, OInputSeekStream::OInputSeekStream( uno::Reference < io::XInputStream > xStream, const uno::Sequence< beans::PropertyValue >& aProps, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : OInputCompStream( xStream, aProps, nStorageType ) { if ( m_xStream.is() ) diff --git a/package/source/xstor/oseekinstream.hxx b/package/source/xstor/oseekinstream.hxx index f8572d717956..92a611af16aa 100644 --- a/package/source/xstor/oseekinstream.hxx +++ b/package/source/xstor/oseekinstream.hxx @@ -42,11 +42,11 @@ public: OInputSeekStream( OWriteStream_Impl& pImpl, ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OInputSeekStream( ::com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xStream, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aProps, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); virtual ~OInputSeekStream(); diff --git a/package/source/xstor/owriteablestream.cxx b/package/source/xstor/owriteablestream.cxx index c5381a11cfea..2e81c80c4321 100644 --- a/package/source/xstor/owriteablestream.cxx +++ b/package/source/xstor/owriteablestream.cxx @@ -35,6 +35,7 @@ #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/IOException.hpp> #include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp> #include <cppuhelper/typeprovider.hxx> #include <cppuhelper/exc_hlp.hxx> @@ -244,7 +245,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, const uno::Reference< lang::XSingleServiceFactory >& xPackage, const uno::Reference< lang::XMultiServiceFactory >& xFactory, sal_Bool bForceEncrypted, - sal_Int16 nStorageType, + sal_Int32 nStorageType, sal_Bool bDefaultCompress, const uno::Reference< io::XInputStream >& xRelInfoStream ) : m_pAntiImpl( NULL ) @@ -254,7 +255,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, , m_xFactory( xFactory ) , m_pParent( pParent ) , m_bForceEncrypted( bForceEncrypted ) -, m_bUseCommonPass( !bForceEncrypted && nStorageType == PACKAGE_STORAGE ) +, m_bUseCommonPass( !bForceEncrypted && nStorageType == embed::StorageFormats::PACKAGE ) , m_bHasCachedPassword( sal_False ) , m_bCompressedSetExplicit( !bDefaultCompress ) , m_xPackage( xPackage ) @@ -269,7 +270,7 @@ OWriteStream_Impl::OWriteStream_Impl( OStorage_Impl* pParent, OSL_ENSURE( xPackage.is(), "No package component is provided!\n" ); OSL_ENSURE( m_xFactory.is(), "No package stream is provided!\n" ); OSL_ENSURE( pParent, "No parent storage is provided!\n" ); - OSL_ENSURE( m_nStorageType == OFOPXML_STORAGE || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" ); + OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML || !m_xOrigRelInfoStream.is(), "The Relations info makes sence only for OFOPXML format!\n" ); } //----------------------------------------------- @@ -359,7 +360,7 @@ void OWriteStream_Impl::InsertIntoPackageFolder( const ::rtl::OUString& aName, //----------------------------------------------- sal_Bool OWriteStream_Impl::IsEncrypted() { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) return sal_False; if ( m_bForceEncrypted || m_bHasCachedPassword ) @@ -419,8 +420,8 @@ sal_Bool OWriteStream_Impl::IsEncrypted() //----------------------------------------------- void OWriteStream_Impl::SetDecrypted() { - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE, "The encryption is supported only for package storages!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); GetStreamProperties(); @@ -444,8 +445,8 @@ void OWriteStream_Impl::SetDecrypted() //----------------------------------------------- void OWriteStream_Impl::SetEncryptedWithPass( const ::rtl::OUString& aPass ) { - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE, "The encryption is supported only for package storages!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE, "The encryption is supported only for package storages!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); GetStreamProperties(); @@ -789,12 +790,12 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt bCompressedIsSet = sal_True; aProps[nInd].Value >>= bCompressed; } - else if ( ( m_nStorageType == OFOPXML_STORAGE || m_nStorageType == PACKAGE_STORAGE ) + else if ( ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) && aProps[nInd].Name.equals( aMedTypePropName ) ) { xPropertySet->setPropertyValue( aProps[nInd].Name, aProps[nInd].Value ); } - else if ( m_nStorageType == PACKAGE_STORAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) + else if ( m_nStorageType == embed::StorageFormats::PACKAGE && aProps[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) aProps[nInd].Value >>= m_bUseCommonPass; else throw lang::IllegalArgumentException(); @@ -816,7 +817,7 @@ void OWriteStream_Impl::InsertStreamDirectly( const uno::Reference< io::XInputSt if ( m_bUseCommonPass ) { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); // set to be encrypted but do not use encryption key @@ -915,7 +916,7 @@ void OWriteStream_Impl::Commit() if ( m_bUseCommonPass ) { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); // set to be encrypted but do not use encryption key @@ -926,7 +927,7 @@ void OWriteStream_Impl::Commit() } else if ( m_bHasCachedPassword ) { - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException(); xPropertySet->setPropertyValue( ::rtl::OUString::createFromAscii( "EncryptionKey" ), @@ -972,7 +973,7 @@ void OWriteStream_Impl::Revert() m_bHasCachedPassword = sal_False; m_aPass = ::rtl::OUString(); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // currently the relations storage is changed only on commit m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -1011,7 +1012,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( uno::Sequence< beans::PropertyValue > aResult( aProps ); sal_Int32 nLen = aResult.getLength(); - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { for ( sal_Int32 nInd = 0; nInd < nLen; nInd++ ) if ( aResult[nInd].Name.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) @@ -1024,7 +1025,7 @@ uno::Sequence< beans::PropertyValue > OWriteStream_Impl::InsertOwnProps( aResult[nLen - 1].Name = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); aResult[nLen - 1].Value <<= bUseCommonPass; } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { ReadRelInfoIfNecessary(); @@ -1061,7 +1062,7 @@ sal_Bool OWriteStream_Impl::IsTransacted() void OWriteStream_Impl::ReadRelInfoIfNecessary() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( m_nRelInfoStatus == RELINFO_NO_INIT ) @@ -1114,24 +1115,24 @@ void OWriteStream_Impl::ReadRelInfoIfNecessary() uno::Sequence< beans::PropertyValue > OWriteStream_Impl::ReadPackageStreamProperties() { sal_Int32 nPropNum = 0; - if ( m_nStorageType == ZIP_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::ZIP ) nPropNum = 2; - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) nPropNum = 3; - else if ( m_nStorageType == PACKAGE_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::PACKAGE ) nPropNum = 4; uno::Sequence< beans::PropertyValue > aResult( nPropNum ); // The "Compressed" property must be set after "MediaType" property, // since the setting of the last one can change the value of the first one - if ( m_nStorageType == OFOPXML_STORAGE || m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML || m_nStorageType == embed::StorageFormats::PACKAGE ) { aResult[0].Name = ::rtl::OUString::createFromAscii("MediaType"); aResult[1].Name = ::rtl::OUString::createFromAscii("Compressed"); aResult[2].Name = ::rtl::OUString::createFromAscii("Size"); - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) aResult[3].Name = ::rtl::OUString::createFromAscii("Encrypted"); } else @@ -1177,7 +1178,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream OSL_ENSURE( !m_bUseCommonPass, "The stream can not be encrypted!" ); - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException(); if ( m_pAntiImpl ) @@ -1201,7 +1202,7 @@ void OWriteStream_Impl::CopyInternallyTo_Impl( const uno::Reference< io::XStream //----------------------------------------------- uno::Sequence< uno::Sequence< beans::StringPair > > OWriteStream_Impl::GetAllRelationshipsIfAny() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); @@ -1516,7 +1517,7 @@ uno::Reference< io::XInputStream > OWriteStream_Impl::GetRawInStream() { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; - if ( m_nStorageType != PACKAGE_STORAGE || !m_pParent ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE || !m_pParent ) throw packages::NoEncryptionException(); return m_pParent->GetCommonRootPass(); @@ -1702,9 +1703,9 @@ void OWriteStream_Impl::GetCopyOfLastCommit( uno::Reference< io::XStream >& xTar void OWriteStream_Impl::CommitStreamRelInfo( const uno::Reference< embed::XStorage >& xRelStorage, const ::rtl::OUString& aOrigStreamName, const ::rtl::OUString& aNewStreamName ) { // at this point of time the old stream must be already cleaned - OSL_ENSURE( m_nStorageType == OFOPXML_STORAGE, "The method should be used only with OFOPXML format!\n" ); + OSL_ENSURE( m_nStorageType == embed::StorageFormats::OFOPXML, "The method should be used only with OFOPXML format!\n" ); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { OSL_ENSURE( aOrigStreamName.getLength() && aNewStreamName.getLength() && xRelStorage.is(), "Wrong relation persistence information is provided!\n" ); @@ -1972,12 +1973,12 @@ void OWriteStream::CopyToStreamInternally_Impl( const uno::Reference< io::XStrea // the order of the properties setting is not important for StorageStream API ::rtl::OUString aPropName = ::rtl::OUString::createFromAscii( "Compressed" ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); - if ( m_pData->m_nStorageType == PACKAGE_STORAGE || m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aPropName = ::rtl::OUString::createFromAscii( "MediaType" ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { aPropName = ::rtl::OUString::createFromAscii( "UseCommonStoragePasswordEncryption" ); xDestProps->setPropertyValue( aPropName, getPropertyValue( aPropName ) ); @@ -2023,13 +2024,13 @@ uno::Any SAL_CALL OWriteStream::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { aReturn <<= ::cppu::queryInterface ( rType , static_cast<embed::XEncryptionProtectedSource*> ( this ) ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -2077,7 +2078,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() { if ( m_bTransacted ) { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2093,7 +2094,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2109,7 +2110,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XTransactionBroadcaster >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else // if ( m_pData->m_nStorageType == ZIP_STORAGE ) + else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2127,7 +2128,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() } else { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2140,7 +2141,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XEncryptionProtectedSource >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2153,7 +2154,7 @@ uno::Sequence< uno::Type > SAL_CALL OWriteStream::getTypes() , ::getCppuType( ( const uno::Reference< embed::XRelationshipAccess >* )NULL ) , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } - else // if ( m_pData->m_nStorageType == ZIP_STORAGE ) + else // if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2752,7 +2753,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); try @@ -2783,7 +2784,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -2808,7 +2809,7 @@ sal_Bool SAL_CALL OWriteStream::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -2833,7 +2834,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OWriteStream::getRelationshipByID( throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); // TODO/LATER: in future the unification of the ID could be checked @@ -2863,7 +2864,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getRe throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -2898,7 +2899,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OWriteStream::getAl throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); return m_pImpl->GetAllRelationshipsIfAny(); @@ -2918,7 +2919,7 @@ void SAL_CALL OWriteStream::insertRelationshipByID( const ::rtl::OUString& sID, throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -2983,7 +2984,7 @@ void SAL_CALL OWriteStream::removeRelationshipByID( const ::rtl::OUString& sID throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -3025,7 +3026,7 @@ void SAL_CALL OWriteStream::insertRelationships( const uno::Sequence< uno::Sequ throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -3107,7 +3108,7 @@ void SAL_CALL OWriteStream::clearRelationships() throw lang::DisposedException(); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException(); m_pImpl->m_aNewRelInfo.realloc( 0 ); @@ -3144,7 +3145,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->GetStreamProperties(); ::rtl::OUString aCompressedString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ); ::rtl::OUString aMediaTypeString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); - if ( m_pData->m_nStorageType == PACKAGE_STORAGE && aPropertyName.equals( aMediaTypeString ) ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equals( aMediaTypeString ) ) { // if the "Compressed" property is not set explicitly, the MediaType can change the default value sal_Bool bCompressedValueFromType = sal_True; @@ -3177,7 +3178,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->m_aProps[nInd].Value = aValue; } } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) { sal_Bool bUseCommonPass = sal_False; @@ -3202,7 +3203,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); //TODO } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equals( aMediaTypeString ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equals( aMediaTypeString ) ) { for ( sal_Int32 nInd = 0; nInd < m_pImpl->m_aProps.getLength(); nInd++ ) { @@ -3210,7 +3211,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa m_pImpl->m_aProps[nInd].Value = aValue; } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equalsAscii( "RelationsInfoStream" ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfoStream" ) ) { uno::Reference< io::XInputStream > xInRelStream; if ( ( aValue >>= xInRelStream ) && xInRelStream.is() ) @@ -3231,7 +3232,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa else throw lang::IllegalArgumentException(); // TODO } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE && aPropertyName.equalsAscii( "RelationsInfo" ) ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aPropertyName.equalsAscii( "RelationsInfo" ) ) { if ( aValue >>= m_pImpl->m_aNewRelInfo ) { @@ -3241,7 +3242,7 @@ void SAL_CALL OWriteStream::setPropertyValue( const ::rtl::OUString& aPropertyNa } else if ( aPropertyName.equalsAscii( "Size" ) ) throw beans::PropertyVetoException(); // TODO - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "IsEncrypted" ) || aPropertyName.equalsAscii( "Encrypted" ) ) ) throw beans::PropertyVetoException(); // TODO else @@ -3277,9 +3278,9 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) else aPropertyName = aProp; - if ( ( ( m_pData->m_nStorageType == PACKAGE_STORAGE || m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( ( ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE || m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) && aPropertyName.equalsAscii( "MediaType" ) ) - || m_pData->m_nStorageType == PACKAGE_STORAGE && aPropertyName.equalsAscii( "Encrypted" ) + || m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "Encrypted" ) || aPropertyName.equalsAscii( "Compressed" ) ) { m_pImpl->GetStreamProperties(); @@ -3290,7 +3291,7 @@ uno::Any SAL_CALL OWriteStream::getPropertyValue( const ::rtl::OUString& aProp ) return m_pImpl->m_aProps[nInd].Value; } } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && aPropertyName.equalsAscii( "UseCommonStoragePasswordEncryption" ) ) return uno::makeAny( m_pImpl->m_bUseCommonPass ); else if ( aPropertyName.equalsAscii( "Size" ) ) diff --git a/package/source/xstor/owriteablestream.hxx b/package/source/xstor/owriteablestream.hxx index 94b97fb09eb2..0d4a29893887 100644 --- a/package/source/xstor/owriteablestream.hxx +++ b/package/source/xstor/owriteablestream.hxx @@ -83,10 +83,10 @@ struct WSInternalData_Impl SotMutexHolderRef m_rSharedMutexRef; ::cppu::OTypeCollection* m_pTypeCollection; ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners - sal_Int16 m_nStorageType; + sal_Int32 m_nStorageType; // the mutex reference MUST NOT be empty - WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int16 nStorageType ) + WSInternalData_Impl( const SotMutexHolderRef rMutexRef, sal_Int32 nStorageType ) : m_rSharedMutexRef( rMutexRef ) , m_pTypeCollection( NULL ) , m_aListenersContainer( rMutexRef->GetMutex() ) @@ -137,7 +137,7 @@ struct OWriteStream_Impl : public PreCreationStruct sal_Bool m_bHasInsertedStreamOptimization; - sal_Int16 m_nStorageType; + sal_Int32 m_nStorageType; // Relations info related data, stored in *.rels file in OFOPXML format ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > m_xOrigRelInfoStream; @@ -175,7 +175,7 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory >& xPackage, const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xFactory, sal_Bool bForceEncrypted, - sal_Int16 nStorageType, + sal_Int32 nStorageType, sal_Bool bDefaultCompress, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xRelInfoStream = ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >() ); diff --git a/package/source/xstor/xfactory.cxx b/package/source/xstor/xfactory.cxx index e78742641a0b..68c393fed08b 100644 --- a/package/source/xstor/xfactory.cxx +++ b/package/source/xstor/xfactory.cxx @@ -29,9 +29,11 @@ #include "precompiled_package.hxx" #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/embed/ElementModes.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/io/XSeekable.hpp> +#include <comphelper/storagehelper.hxx> #include "xfactory.hxx" #include "xstorage.hxx" @@ -101,7 +103,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstance() embed::ElementModes::READWRITE, uno::Sequence< beans::PropertyValue >(), m_xFactory, - PACKAGE_STORAGE ) ), + embed::StorageFormats::PACKAGE ) ), uno::UNO_QUERY ); } @@ -184,7 +186,7 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr uno::Sequence< beans::PropertyValue > aDescr; uno::Sequence< beans::PropertyValue > aPropsToSet; - sal_Int16 nStorageType = PACKAGE_STORAGE; + sal_Int32 nStorageType = embed::StorageFormats::PACKAGE; if ( nArgNum >= 3 ) { @@ -212,15 +214,29 @@ uno::Reference< uno::XInterface > SAL_CALL OStorageFactory::createInstanceWithAr else if ( aDescr[nInd].Name.equalsAscii( "StorageFormat" ) ) { ::rtl::OUString aFormatName; - aDescr[nInd].Value >>= aFormatName; - if ( aFormatName.equalsAscii( "PackageFormat" ) ) - nStorageType = PACKAGE_STORAGE; - else if ( aFormatName.equalsAscii( "ZipFormat" ) ) - nStorageType = ZIP_STORAGE; - else if ( aFormatName.equalsAscii( "OFOPXMLFormat" ) ) - nStorageType = OFOPXML_STORAGE; + sal_Int32 nFormatID = 0; + if ( aDescr[nInd].Value >>= aFormatName ) + { + if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) ) + nStorageType = embed::StorageFormats::PACKAGE; + else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) ) + nStorageType = embed::StorageFormats::ZIP; + else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) + nStorageType = embed::StorageFormats::OFOPXML; + else + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + } + else if ( aDescr[nInd].Value >>= nFormatID ) + { + if ( nFormatID != embed::StorageFormats::PACKAGE + && nFormatID != embed::StorageFormats::ZIP + && nFormatID != embed::StorageFormats::OFOPXML ) + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + + nStorageType = nFormatID; + } else - throw lang::IllegalArgumentException(); // TODO: + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); } else OSL_ENSURE( sal_False, "Unacceptable property, will be ignored!\n" ); diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 55ff5a87e78d..007f199332c5 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -30,6 +30,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/embed/UseBackupException.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/ucb/XProgressHandler.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XEnumerationAccess.hpp> @@ -72,7 +73,7 @@ struct StorInternalData_Impl ::cppu::OMultiTypeInterfaceContainerHelper m_aListenersContainer; // list of listeners ::cppu::OTypeCollection* m_pTypeCollection; sal_Bool m_bIsRoot; - sal_Int16 m_nStorageType; // the mode in wich the storage is used + sal_Int32 m_nStorageType; // the mode in wich the storage is used sal_Bool m_bReadOnlyWrap; OChildDispListener_Impl* m_pSubElDispListener; @@ -82,12 +83,12 @@ struct StorInternalData_Impl ::rtl::Reference< OHierarchyHolder_Impl > m_rHierarchyHolder; // the mutex reference MUST NOT be empty - StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int16 nStorType, sal_Bool bReadOnlyWrap ) + StorInternalData_Impl( const SotMutexHolderRef& rMutexRef, sal_Bool bRoot, sal_Int32 nStorageType, sal_Bool bReadOnlyWrap ) : m_rSharedMutexRef( rMutexRef ) , m_aListenersContainer( rMutexRef->GetMutex() ) , m_pTypeCollection( NULL ) , m_bIsRoot( bRoot ) - , m_nStorageType( nStorType ) + , m_nStorageType( nStorageType ) , m_bReadOnlyWrap( bReadOnlyWrap ) , m_pSubElDispListener( NULL ) {} @@ -102,7 +103,7 @@ struct StorInternalData_Impl void OStorage_Impl::completeStorageStreamCopy_Impl( const uno::Reference< io::XStream >& xSource, const uno::Reference< io::XStream >& xDest, - sal_Int16 nStorageType, + sal_Int32 nStorageType, const uno::Sequence< uno::Sequence< beans::StringPair > >& aRelInfo ) { uno::Reference< beans::XPropertySet > xSourceProps( xSource, uno::UNO_QUERY ); @@ -124,13 +125,13 @@ void OStorage_Impl::completeStorageStreamCopy_Impl( uno::Sequence< ::rtl::OUString > aPropNames( 1 ); aPropNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Compressed" ) ); - if ( nStorageType == PACKAGE_STORAGE ) + if ( nStorageType == embed::StorageFormats::PACKAGE ) { aPropNames.realloc( 3 ); aPropNames[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); aPropNames[2] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); } - else if ( nStorageType == OFOPXML_STORAGE ) + else if ( nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: in future it might make sence to provide the stream if there is one uno::Reference< embed::XRelationshipAccess > xRelAccess( xDest, uno::UNO_QUERY_THROW ); @@ -195,7 +196,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XInputStream > xInputStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_rMutexRef( new SotMutexHolder ) , m_pAntiImpl( NULL ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) @@ -235,7 +236,7 @@ OStorage_Impl::OStorage_Impl( uno::Reference< io::XStream > xStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_rMutexRef( new SotMutexHolder ) , m_pAntiImpl( NULL ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) @@ -278,7 +279,7 @@ OStorage_Impl::OStorage_Impl( OStorage_Impl* pParent, uno::Reference< container::XNameContainer > xPackageFolder, uno::Reference< lang::XSingleServiceFactory > xPackage, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_rMutexRef( new SotMutexHolder ) , m_pAntiImpl( NULL ) , m_nStorageMode( nMode & ~embed::ElementModes::SEEKABLE ) @@ -356,7 +357,7 @@ OStorage_Impl::~OStorage_Impl() m_aDeletedList.clear(); - if ( m_nStorageType == OFOPXML_STORAGE && m_pRelStorElement ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_pRelStorElement ) { delete m_pRelStorElement; m_pRelStorElement = NULL; @@ -500,7 +501,7 @@ void OStorage_Impl::OpenOwnPackage() } } - if ( m_nStorageType == ZIP_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::ZIP ) { // let the package support only plain zip format beans::NamedValue aNamedValue; @@ -509,7 +510,7 @@ void OStorage_Impl::OpenOwnPackage() aArguments.realloc( ++nArgNum ); aArguments[nArgNum-1] <<= aNamedValue; } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // let the package support OFOPXML media type handling beans::NamedValue aNamedValue; @@ -562,7 +563,7 @@ SotElementList_Impl& OStorage_Impl::GetChildrenList() //----------------------------------------------- void OStorage_Impl::GetStorageProperties() { - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { uno::Reference< beans::XPropertySet > xProps( m_xPackageFolder, uno::UNO_QUERY_THROW ); @@ -588,7 +589,7 @@ void OStorage_Impl::GetStorageProperties() //----------------------------------------------- void OStorage_Impl::ReadRelInfoIfNecessary() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( m_nRelInfoStatus == RELINFO_NO_INIT ) @@ -662,7 +663,7 @@ void OStorage_Impl::ReadContents() uno::Reference< container::XNameContainer > xNameContainer( xNamed, uno::UNO_QUERY ); SotElement_Impl* pNewElement = new SotElement_Impl( aName, xNameContainer.is(), sal_False ); - if ( m_nStorageType == OFOPXML_STORAGE && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) { if ( !pNewElement->m_bIsStorage ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Unexpected format @@ -730,7 +731,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } // move storage properties to the destination one ( means changeable properties ) - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { ::rtl::OUString aMediaTypeString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MediaType" ) ); ::rtl::OUString aVersionString = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ); @@ -738,7 +739,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes xPropSet->setPropertyValue( aVersionString, uno::makeAny( m_aVersion ) ); } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { // if this is a root storage, the common key from current one should be moved there sal_Bool bIsRoot = sal_False; @@ -759,7 +760,7 @@ void OStorage_Impl::CopyToStorage( const uno::Reference< embed::XStorage >& xDes } } } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: currently the optimization is not active @@ -850,13 +851,13 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, } } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { aStrProps.realloc( ++nNum ); aStrProps[nNum-1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "UseCommonStoragePasswordEncryption" ) ); aStrProps[nNum-1].Value <<= (sal_Bool)( pElement->m_pStream->UsesCommonPass_Impl() ); } - else if ( m_nStorageType == OFOPXML_STORAGE ) + else if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // TODO/LATER: currently the optimization is not active // uno::Reference< io::XInputStream > xInStream = GetRelInfoStreamForName( ::rtl::OUString() ); // own rels stream @@ -907,7 +908,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, pElement->m_pStream->CopyInternallyTo_Impl( xSubStr ); } } - else if ( m_nStorageType != PACKAGE_STORAGE ) + else if ( m_nStorageType != embed::StorageFormats::PACKAGE ) { OSL_ENSURE( sal_False, "Encryption is only supported in package storage!\n" ); throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -994,7 +995,7 @@ void OStorage_Impl::CopyStorageElement( SotElement_Impl* pElement, //----------------------------------------------- uno::Sequence< uno::Sequence< beans::StringPair > > OStorage_Impl::GetAllRelationshipsIfAny() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return uno::Sequence< uno::Sequence< beans::StringPair > >(); ReadRelInfoIfNecessary(); @@ -1088,7 +1089,7 @@ void OStorage_Impl::Commit() pDeletedIter++ ) { - if ( m_nStorageType == OFOPXML_STORAGE && !(*pDeletedIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pDeletedIter)->m_bIsStorage ) RemoveStreamRelInfo( (*pDeletedIter)->m_aOriginalName ); // the removed elements are not in new temporary storage @@ -1108,7 +1109,7 @@ void OStorage_Impl::Commit() if ( (*pElementIter)->m_bIsRemoved ) { - if ( m_nStorageType == OFOPXML_STORAGE && !(*pElementIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pElementIter)->m_bIsStorage ) RemoveStreamRelInfo( (*pElementIter)->m_aOriginalName ); // the removed elements are not in new temporary storage @@ -1158,7 +1159,7 @@ void OStorage_Impl::Commit() } else if ( !(*pElementIter)->m_bIsStorage && (*pElementIter)->m_pStream && (*pElementIter)->m_pStream->m_bFlushed ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitStreamRelInfo( *pElementIter ); // the renamed elements are not in new temporary storage @@ -1184,7 +1185,7 @@ void OStorage_Impl::Commit() xNewPackageFolder->removeByName( (*pElementIter)->m_aOriginalName ); xNewPackageFolder->insertByName( (*pElementIter)->m_aName, aPackageElement ); - if ( m_nStorageType == OFOPXML_STORAGE && !(*pElementIter)->m_bIsStorage ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && !(*pElementIter)->m_bIsStorage ) { if ( !(*pElementIter)->m_pStream ) { @@ -1233,7 +1234,7 @@ void OStorage_Impl::Commit() if ( (*pElementIter)->m_pStream->m_bFlushed ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitStreamRelInfo( *pElementIter ); (*pElementIter)->m_pStream->InsertIntoPackageFolder( (*pElementIter)->m_aName, xNewPackageFolder ); @@ -1244,7 +1245,7 @@ void OStorage_Impl::Commit() } } - if ( m_nStorageType == PACKAGE_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::PACKAGE ) { // move properties to the destination package folder uno::Reference< beans::XPropertySet > xProps( xNewPackageFolder, uno::UNO_QUERY ); @@ -1255,7 +1256,7 @@ void OStorage_Impl::Commit() xProps->setPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ), uno::makeAny( m_aVersion ) ); } - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) CommitRelInfo( xNewPackageFolder ); // store own relations and commit complete relations storage if ( m_bIsRoot ) @@ -1349,7 +1350,7 @@ void OStorage_Impl::Revert() GetStorageProperties(); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { // currently the relations storage is changed only on commit m_xNewRelInfoStream = uno::Reference< io::XInputStream >(); @@ -1364,7 +1365,7 @@ void OStorage_Impl::Revert() { ::osl::MutexGuard aGuard( m_rMutexRef->GetMutex() ) ; - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( m_bIsRoot ) @@ -1422,8 +1423,8 @@ SotElement_Impl* OStorage_Impl::InsertStream( ::rtl::OUString aName, sal_Bool bE if ( !xPackageSubStream.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - OSL_ENSURE( m_nStorageType == PACKAGE_STORAGE || !bEncr, "Only package storage supports encryption!\n" ); - if ( m_nStorageType != PACKAGE_STORAGE && bEncr ) + OSL_ENSURE( m_nStorageType == embed::StorageFormats::PACKAGE || !bEncr, "Only package storage supports encryption!\n" ); + if ( m_nStorageType != embed::StorageFormats::PACKAGE && bEncr ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the mode is not needed for storage stream internal implementation @@ -1445,7 +1446,7 @@ SotElement_Impl* OStorage_Impl::InsertRawStream( ::rtl::OUString aName, const un if ( !m_xPackage.is() ) throw embed::InvalidStorageException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType != PACKAGE_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Reference< io::XSeekable > xSeek( xInStream, uno::UNO_QUERY ); @@ -1726,7 +1727,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) // this method should be used only in OStorage_Impl::Commit() method // the aOriginalName can be empty, in this case the storage relation info should be removed - if ( m_nStorageType == OFOPXML_STORAGE && m_xRelStorage.is() ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && m_xRelStorage.is() ) { ::rtl::OUString aRelStreamName = aOriginalName; aRelStreamName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".rels" ) ); @@ -1739,7 +1740,7 @@ void OStorage_Impl::RemoveStreamRelInfo( const ::rtl::OUString& aOriginalName ) //----------------------------------------------- void OStorage_Impl::CreateRelStorage() { - if ( m_nStorageType != OFOPXML_STORAGE ) + if ( m_nStorageType != embed::StorageFormats::OFOPXML ) return; if ( !m_xRelStorage.is() ) @@ -1772,7 +1773,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) if ( !pStreamElement ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType == OFOPXML_STORAGE && pStreamElement->m_pStream ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML && pStreamElement->m_pStream ) { OSL_ENSURE( pStreamElement->m_aName.getLength(), "The name must not be empty!\n" ); @@ -1789,7 +1790,7 @@ void OStorage_Impl::CommitStreamRelInfo( SotElement_Impl* pStreamElement ) //----------------------------------------------- uno::Reference< io::XInputStream > OStorage_Impl::GetRelInfoStreamForName( const ::rtl::OUString& aName ) { - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { ReadContents(); if ( m_xRelStorage.is() ) @@ -1817,7 +1818,7 @@ void OStorage_Impl::CommitRelInfo( const uno::Reference< container::XNameContain if ( !xNewPackageFolder.is() ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - if ( m_nStorageType == OFOPXML_STORAGE ) + if ( m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( m_nRelInfoStatus == RELINFO_BROKEN || m_nRelInfoStatus == RELINFO_CHANGED_BROKEN ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); @@ -1923,7 +1924,7 @@ OStorage::OStorage( uno::Reference< io::XInputStream > xInputStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( new OStorage_Impl( xInputStream, nMode, xProperties, xFactory, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; @@ -1935,7 +1936,7 @@ OStorage::OStorage( uno::Reference< io::XStream > xStream, sal_Int32 nMode, uno::Sequence< beans::PropertyValue > xProperties, uno::Reference< lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ) + sal_Int32 nStorageType ) : m_pImpl( new OStorage_Impl( xStream, nMode, xProperties, xFactory, nStorageType ) ) { m_pImpl->m_pAntiImpl = this; @@ -2259,7 +2260,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) if ( aReturn.hasValue() == sal_True ) return aReturn ; - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( m_pData->m_bIsRoot ) { @@ -2275,7 +2276,7 @@ uno::Any SAL_CALL OStorage::queryInterface( const uno::Type& rType ) , static_cast<embed::XStorageRawAccess*> ( this ) ); } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { aReturn <<= ::cppu::queryInterface ( rType @@ -2314,7 +2315,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() if ( m_pData->m_pTypeCollection == NULL ) { - if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( m_pData->m_bIsRoot ) { @@ -2340,7 +2341,7 @@ uno::Sequence< uno::Type > SAL_CALL OStorage::getTypes() , ::getCppuType( ( const uno::Reference< beans::XPropertySet >* )NULL ) ); } } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { m_pData->m_pTypeCollection = new ::cppu::OTypeCollection ( ::getCppuType( ( const uno::Reference< lang::XTypeProvider >* )NULL ) @@ -2482,7 +2483,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openStreamElement( if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name @@ -2583,7 +2584,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::openEncryptedStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( ( nOpenMode & embed::ElementModes::WRITE ) && m_pData->m_bReadOnlyWrap ) @@ -2693,7 +2694,7 @@ uno::Reference< embed::XStorage > SAL_CALL OStorage::openStorageElement( if ( !aStorName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -2848,7 +2849,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneStreamElement( const ::rtl if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -2930,7 +2931,7 @@ uno::Reference< io::XStream > SAL_CALL OStorage::cloneEncryptedStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) packages::NoEncryptionException(); if ( !aPass.getLength() ) @@ -3087,7 +3088,7 @@ void SAL_CALL OStorage::copyStorageElementLastCommitTo( if ( !aStorName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStorName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStorName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -3181,7 +3182,7 @@ sal_Bool SAL_CALL OStorage::isStreamElement( const ::rtl::OUString& aElementName if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name @@ -3250,7 +3251,7 @@ sal_Bool SAL_CALL OStorage::isStorageElement( const ::rtl::OUString& aElementNam if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); @@ -3323,7 +3324,7 @@ void SAL_CALL OStorage::removeElement( const ::rtl::OUString& aElementName ) if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name @@ -3418,7 +3419,7 @@ void SAL_CALL OStorage::renameElement( const ::rtl::OUString& aElementName, cons || !aNewName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aNewName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // TODO: unacceptable element name @@ -3529,7 +3530,7 @@ void SAL_CALL OStorage::copyElementTo( const ::rtl::OUString& aElementName, // || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name @@ -3633,7 +3634,7 @@ void SAL_CALL OStorage::moveElementTo( const ::rtl::OUString& aElementName, if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable element name @@ -3743,7 +3744,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getPlainRawStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface is not supported and must not be accessible if ( !sStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) @@ -3853,7 +3854,7 @@ uno::Reference< io::XInputStream > SAL_CALL OStorage::getRawEncrStreamElement( throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !sStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( sStreamName, sal_False ) ) @@ -3973,7 +3974,7 @@ void SAL_CALL OStorage::insertRawEncrStreamElement( const ::rtl::OUString& aStre throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) @@ -4334,7 +4335,7 @@ uno::Any SAL_CALL OStorage::getByName( const ::rtl::OUString& aName ) if ( !aName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable element name @@ -4439,7 +4440,7 @@ sal_Bool SAL_CALL OStorage::hasByName( const ::rtl::OUString& aName ) if ( !aName.getLength() ) return sal_False; - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) return sal_False; @@ -4616,7 +4617,7 @@ void SAL_CALL OStorage::setEncryptionPassword( const ::rtl::OUString& aPass ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage OSL_ENSURE( m_pData->m_bIsRoot, "setEncryptionPassword() method is not available for nonroot storages!\n" ); @@ -4682,7 +4683,7 @@ void SAL_CALL OStorage::removeEncryption() throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // the interface must be visible only for package storage OSL_ENSURE( m_pData->m_bIsRoot, "removeEncryption() method is not available for nonroot storages!\n" ); @@ -4783,9 +4784,9 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, if ( m_pData->m_bReadOnlyWrap && !aPropertyName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Version" ) ) ) ) throw io::IOException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO: Access denied - if ( m_pData->m_nStorageType == ZIP_STORAGE ) + if ( m_pData->m_nStorageType == embed::StorageFormats::ZIP ) throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE ) { if ( aPropertyName.equalsAscii( "MediaType" ) ) { @@ -4818,7 +4819,7 @@ void SAL_CALL OStorage::setPropertyValue( const ::rtl::OUString& aPropertyName, else throw beans::UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - else if ( m_pData->m_nStorageType == OFOPXML_STORAGE ) + else if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML ) { if ( aPropertyName.equalsAscii( "RelationsInfoStream" ) ) { @@ -4885,7 +4886,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType == PACKAGE_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "MediaType" ) || aPropertyName.equalsAscii( "MediaTypeFallbackUsed" ) || aPropertyName.equalsAscii( "Version" ) ) ) @@ -4943,7 +4944,7 @@ uno::Any SAL_CALL OStorage::getPropertyValue( const ::rtl::OUString& aPropertyNa return uno::makeAny( sal_False ); // RepairPackage } - else if ( m_pData->m_nStorageType == PACKAGE_STORAGE + else if ( m_pData->m_nStorageType == embed::StorageFormats::PACKAGE && ( aPropertyName.equalsAscii( "HasEncryptedEntries" ) || aPropertyName.equalsAscii( "HasNonEncryptedEntries" ) || aPropertyName.equalsAscii( "IsInconsistent" ) ) ) @@ -5078,7 +5079,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); try @@ -5109,7 +5110,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -5134,7 +5135,7 @@ sal_Bool SAL_CALL OStorage::hasByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< beans::StringPair > aSeq = getRelationshipByID( sID ); @@ -5159,7 +5160,7 @@ uno::Sequence< beans::StringPair > SAL_CALL OStorage::getRelationshipByID( cons throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: in future the unification of the ID could be checked @@ -5189,7 +5190,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getRelati throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aResult; @@ -5225,7 +5226,7 @@ uno::Sequence< uno::Sequence< beans::StringPair > > SAL_CALL OStorage::getAllRel throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return m_pImpl->GetAllRelationshipsIfAny(); @@ -5245,7 +5246,7 @@ void SAL_CALL OStorage::insertRelationshipByID( const ::rtl::OUString& sID, con throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -5310,7 +5311,7 @@ void SAL_CALL OStorage::removeRelationshipByID( const ::rtl::OUString& sID ) throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); uno::Sequence< uno::Sequence< beans::StringPair > > aSeq = getAllRelationships(); @@ -5352,7 +5353,7 @@ void SAL_CALL OStorage::insertRelationships( const uno::Sequence< uno::Sequence throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); ::rtl::OUString aIDTag( RTL_CONSTASCII_USTRINGPARAM( "Id" ) ); @@ -5434,7 +5435,7 @@ void SAL_CALL OStorage::clearRelationships() throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != OFOPXML_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::OFOPXML ) throw uno::RuntimeException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); m_pImpl->m_aRelInfo.realloc( 0 ); @@ -5487,7 +5488,7 @@ void SAL_CALL OStorage::insertStreamElementDirect( if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable storage name @@ -5584,7 +5585,7 @@ void SAL_CALL OStorage::copyElementDirectlyTo( if ( !xDest.is() || xDest == uno::Reference< uno::XInterface >( static_cast< OWeakObject* >( this ), uno::UNO_QUERY ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 2 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && ( aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) || aNewName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 0 ); // unacceptable name @@ -5840,7 +5841,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle if ( !aElementName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aElementName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aElementName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // TODO: unacceptable name @@ -5851,7 +5852,7 @@ uno::Any SAL_CALL OStorage::getElementPropertyValue( const ::rtl::OUString& aEle throw container::NoSuchElementException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); // TODO/LATER: Currently it is only implemented for MediaType property of substorages, might be changed in future - if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != PACKAGE_STORAGE || !aPropertyName.equalsAscii( "MediaType" ) ) + if ( !pElement->m_bIsStorage || m_pData->m_nStorageType != embed::StorageFormats::PACKAGE || !aPropertyName.equalsAscii( "MediaType" ) ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !pElement->m_pStorage ) @@ -5943,7 +5944,7 @@ void SAL_CALL OStorage::copyStreamElementData( const ::rtl::OUString& aStreamNam if ( !aStreamName.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamName, sal_False ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX "Unexpected entry name syntax." ) ), uno::Reference< uno::XInterface >(), 1 ); - if ( m_pData->m_nStorageType == OFOPXML_STORAGE + if ( m_pData->m_nStorageType == embed::StorageFormats::OFOPXML && aStreamName.equals( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "_rels" ) ) ) ) throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); // unacceptable name @@ -6090,7 +6091,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL OStorage::openEncrypted throw lang::DisposedException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); } - if ( m_pData->m_nStorageType != PACKAGE_STORAGE ) + if ( m_pData->m_nStorageType != embed::StorageFormats::PACKAGE ) throw packages::NoEncryptionException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( !aStreamPath.getLength() || !::comphelper::OStorageHelper::IsValidZipEntryFileName( aStreamPath, sal_True ) ) diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index bc90b71e4d93..f1c50e4d67bd 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -57,11 +57,6 @@ #include "mutexholder.hxx" - -#define PACKAGE_STORAGE 0 -#define ZIP_STORAGE 1 -#define OFOPXML_STORAGE 2 - #define RELINFO_NO_INIT 1 #define RELINFO_READ 2 #define RELINFO_CHANGED 3 @@ -177,9 +172,9 @@ struct OStorage_Impl SwitchablePersistenceStream* m_pSwitchStream; - sal_Int16 m_nStorageType; // the mode in wich the storage is used + sal_Int32 m_nStorageType; // the mode in wich the storage is used - // the _rels substorage that is handled in a special way in OFOPXML_STORAGE + // the _rels substorage that is handled in a special way in embed::StorageFormats::OFOPXML SotElement_Impl* m_pRelStorElement; ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xRelStorage; ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > > m_aRelInfo; @@ -193,13 +188,13 @@ struct OStorage_Impl sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OStorage_Impl( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); // constructor for a substorage OStorage_Impl( OStorage_Impl* pParent, @@ -207,7 +202,7 @@ struct OStorage_Impl ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > xPackageFolder, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xPackage, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); ~OStorage_Impl(); @@ -287,7 +282,7 @@ struct OStorage_Impl static void completeStorageStreamCopy_Impl( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSource, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xDest, - sal_Int16 nStorageType, + sal_Int32 nStorageType, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > >& aRelInfo ); }; @@ -330,13 +325,13 @@ public: sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OStorage( ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream > xStream, sal_Int32 nMode, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > xProperties, ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xFactory, - sal_Int16 nStorageType ); + sal_Int32 nStorageType ); OStorage( OStorage_Impl* pImpl, sal_Bool bReadOnlyWrap ); diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 5c22bad46a6a..9ba26e0100c5 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -61,6 +61,7 @@ #include <com/sun/star/io/XActiveDataStreamer.hpp> #include <com/sun/star/embed/XTransactedObject.hpp> #include <com/sun/star/embed/UseBackupException.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/beans/NamedValue.hpp> #include <cppuhelper/implbase1.hxx> #include <ContentInfo.hxx> @@ -183,7 +184,7 @@ ZipPackage::ZipPackage (const uno::Reference < XMultiServiceFactory > &xNewFacto , m_bUseManifest ( sal_True ) , m_bForceRecovery ( sal_False ) , m_bMediaTypeFallbackUsed ( sal_False ) -, m_nFormat( PACKAGE_FORMAT ) // package is the default format +, m_nFormat( embed::StorageFormats::PACKAGE ) // package is the default format , m_bAllowRemoveOnInsert( sal_True ) , m_eMode ( e_IMode_None ) , m_xFactory( xNewFactory ) @@ -217,7 +218,7 @@ ZipPackage::~ZipPackage( void ) void ZipPackage::parseManifest() { - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) { sal_Bool bManifestParsed = sal_False; const OUString sMeta ( RTL_CONSTASCII_USTRINGPARAM ( "META-INF" ) ); @@ -427,7 +428,7 @@ void ZipPackage::parseManifest() void ZipPackage::parseContentType() { - if ( m_nFormat == OFOPXML_FORMAT ) + if ( m_nFormat == embed::StorageFormats::OFOPXML ) { const ::rtl::OUString aContentTypes( RTL_CONSTASCII_USTRINGPARAM ( "[Content_Types].xml" ) ); try { @@ -507,7 +508,14 @@ void ZipPackage::getZipFileContents() nIndex = nOldIndex = 0; pCurrent = m_pRootFolder; const ZipEntry & rEntry = *pEnum->nextElement(); - const OUString & rName = rEntry.sPath; + OUString rName = rEntry.sPath; + + if ( m_bForceRecovery ) + { + // the PKZIP Application note version 6.2 does not allows to use '\' as separator + // unfortunately it is used by some implementations, so we have to support it in recovery mode + rName = rName.replace( '\\', '/' ); + } nStreamIndex = rName.lastIndexOf ( '/' ); if ( nStreamIndex != -1 ) @@ -551,9 +559,9 @@ void ZipPackage::getZipFileContents() } } - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) parseManifest(); - else if ( m_nFormat == OFOPXML_FORMAT ) + else if ( m_nFormat == embed::StorageFormats::OFOPXML ) parseContentType(); } @@ -593,13 +601,13 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) } else if ( aCommand.equals( OUString::createFromAscii( "purezip" ) ) ) { - m_nFormat = ZIP_FORMAT; + m_nFormat = embed::StorageFormats::ZIP; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); break; } else if ( aCommand.equals( OUString::createFromAscii( "ofopxml" ) ) ) { - m_nFormat = OFOPXML_FORMAT; + m_nFormat = embed::StorageFormats::OFOPXML; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); break; } @@ -654,20 +662,34 @@ void SAL_CALL ZipPackage::initialize( const Sequence< Any >& aArguments ) sal_Bool bPackFormat = sal_True; aNamedValue.Value >>= bPackFormat; if ( !bPackFormat ) - m_nFormat = ZIP_FORMAT; + m_nFormat = embed::StorageFormats::ZIP; m_pRootFolder->setPackageFormat_Impl( m_nFormat ); } else if ( aNamedValue.Name.equalsAscii( "StorageFormat" ) ) { ::rtl::OUString aFormatName; - aNamedValue.Value >>= aFormatName; - if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) ) - m_nFormat = PACKAGE_FORMAT; - else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) ) - m_nFormat = ZIP_FORMAT; - else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) - m_nFormat = OFOPXML_FORMAT; + sal_Int32 nFormatID = 0; + if ( aNamedValue.Value >>= aFormatName ) + { + if ( aFormatName.equals( PACKAGE_STORAGE_FORMAT_STRING ) ) + m_nFormat = embed::StorageFormats::PACKAGE; + else if ( aFormatName.equals( ZIP_STORAGE_FORMAT_STRING ) ) + m_nFormat = embed::StorageFormats::ZIP; + else if ( aFormatName.equals( OFOPXML_STORAGE_FORMAT_STRING ) ) + m_nFormat = embed::StorageFormats::OFOPXML; + else + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + } + else if ( aNamedValue.Value >>= nFormatID ) + { + if ( nFormatID != embed::StorageFormats::PACKAGE + && nFormatID != embed::StorageFormats::ZIP + && nFormatID != embed::StorageFormats::OFOPXML ) + throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); + + m_nFormat = nFormatID; + } else throw lang::IllegalArgumentException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >(), 1 ); @@ -1135,7 +1157,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() try { - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) { // Remove the old manifest.xml file as the // manifest will be re-generated and the @@ -1157,7 +1179,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Write a magic file with mimetype WriteMimetypeMagicFile( aZipOut ); } - else if ( m_nFormat == OFOPXML_FORMAT ) + else if ( m_nFormat == embed::StorageFormats::OFOPXML ) { // Remove the old [Content_Types].xml file as the // file will be re-generated @@ -1175,7 +1197,7 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() const OUString sVersion ( RTL_CONSTASCII_USTRINGPARAM ( "Version" ) ); const OUString sFullPath ( RTL_CONSTASCII_USTRINGPARAM ( "FullPath" ) ); - if ( m_nFormat == PACKAGE_FORMAT ) + if ( m_nFormat == embed::StorageFormats::PACKAGE ) { Sequence < PropertyValue > aPropSeq ( PKG_SIZE_NOENCR_MNFST ); aPropSeq [PKG_MNFST_MEDIATYPE].Name = sMediaType; @@ -1204,11 +1226,11 @@ uno::Reference< io::XInputStream > ZipPackage::writeTempFile() // Clean up random pool memory rtl_random_destroyPool ( aRandomPool ); - if( m_bUseManifest && m_nFormat == PACKAGE_FORMAT ) + if( m_bUseManifest && m_nFormat == embed::StorageFormats::PACKAGE ) { WriteManifest( aZipOut, aManList ); } - else if( m_nFormat == OFOPXML_FORMAT ) + else if( m_nFormat == embed::StorageFormats::OFOPXML ) { WriteContentTypes( aZipOut, aManList ); } @@ -1618,7 +1640,7 @@ uno::Reference< XPropertySetInfo > SAL_CALL ZipPackage::getPropertySetInfo( ) void SAL_CALL ZipPackage::setPropertyValue( const OUString& aPropertyName, const Any& aValue ) throw(UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - if ( m_nFormat != PACKAGE_FORMAT ) + if ( m_nFormat != embed::StorageFormats::PACKAGE ) throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("HasEncryptedEntries") ) @@ -1643,7 +1665,7 @@ Any SAL_CALL ZipPackage::getPropertyValue( const OUString& PropertyName ) throw(UnknownPropertyException, WrappedTargetException, RuntimeException) { // TODO/LATER: Activate the check when zip-ucp is ready - // if ( m_nFormat != PACKAGE_FORMAT ) + // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); Any aAny; diff --git a/package/source/zippackage/ZipPackageFolder.cxx b/package/source/zippackage/ZipPackageFolder.cxx index 0bed74128467..b4648426049e 100644 --- a/package/source/zippackage/ZipPackageFolder.cxx +++ b/package/source/zippackage/ZipPackageFolder.cxx @@ -34,6 +34,7 @@ #include <PackageConstants.hxx> #include <ZipPackageFolderEnumeration.hxx> #include <com/sun/star/packages/zip/ZipConstants.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <vos/diagnose.hxx> #include <osl/time.h> #include <rtl/digest.h> @@ -61,7 +62,7 @@ using vos::ORef; Sequence < sal_Int8 > ZipPackageFolder::aImplementationId = Sequence < sal_Int8 > (); ZipPackageFolder::ZipPackageFolder ( const Reference< XMultiServiceFactory >& xFactory, - sal_Int16 nFormat, + sal_Int32 nFormat, sal_Bool bAllowRemoveOnInsert ) : m_xFactory( xFactory ) , m_nFormat( nFormat ) @@ -317,7 +318,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr sal_Bool bHaveEncryptionKey = rEncryptionKey.getLength() ? sal_True : sal_False; - if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != OFOPXML_FORMAT ) + if ( maContents.begin() == maContents.end() && rPath.getLength() && m_nFormat != embed::StorageFormats::OFOPXML ) { // it is an empty subfolder, use workaround to store it ZipEntry* pTempEntry = new ZipEntry(); @@ -539,11 +540,11 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr // If the entry is already stored in the zip file in the format we // want for this write...copy it raw - if ( !bUseNonSeekableAccess && - ( bRawStream || bTransportOwnEncrStreamAsRaw || - ( pStream->IsPackageMember() && !bToBeEncrypted && - ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) || - ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) + if ( !bUseNonSeekableAccess + && ( bRawStream || bTransportOwnEncrStreamAsRaw + || ( pStream->IsPackageMember() && !bToBeEncrypted + && ( ( pStream->aEntry.nMethod == DEFLATED && bToBeCompressed ) + || ( pStream->aEntry.nMethod == STORED && !bToBeCompressed ) ) ) ) ) { // If it's a PackageMember, then it's an unbuffered stream and we need // to get a new version of it as we can't seek backwards. @@ -689,7 +690,7 @@ void ZipPackageFolder::saveContents(OUString &rPath, std::vector < Sequence < Pr } // folder can have a mediatype only in package format - if ( m_nFormat == PACKAGE_FORMAT || ( m_nFormat == OFOPXML_FORMAT && !rInfo.bFolder ) ) + if ( m_nFormat == embed::StorageFormats::PACKAGE || ( m_nFormat == embed::StorageFormats::OFOPXML && !rInfo.bFolder ) ) rManList.push_back( aPropSet ); } @@ -741,7 +742,7 @@ void SAL_CALL ZipPackageFolder::setPropertyValue( const OUString& aPropertyName, if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType"))) { // TODO/LATER: activate when zip ucp is ready - // if ( m_nFormat != PACKAGE_FORMAT ) + // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); aValue >>= sMediaType; @@ -759,7 +760,7 @@ Any SAL_CALL ZipPackageFolder::getPropertyValue( const OUString& PropertyName ) if (PropertyName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "MediaType" ) ) ) { // TODO/LATER: activate when zip ucp is ready - // if ( m_nFormat != PACKAGE_FORMAT ) + // if ( m_nFormat != embed::StorageFormats::PACKAGE ) // throw UnknownPropertyException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); return makeAny ( sMediaType ); diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index b6893b5cb2ad..6343607c8711 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -28,6 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_package.hxx" #include <com/sun/star/packages/zip/ZipConstants.hpp> +#include <com/sun/star/embed/StorageFormats.hpp> #include <com/sun/star/packages/zip/ZipIOException.hpp> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XOutputStream.hpp> @@ -611,7 +612,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, { if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("MediaType"))) { - if ( rZipPackage.getFormat() != PACKAGE_FORMAT && rZipPackage.getFormat() != OFOPXML_FORMAT ) + if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE && rZipPackage.getFormat() != embed::StorageFormats::OFOPXML ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); if ( aValue >>= sMediaType ) @@ -640,7 +641,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, } else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("Encrypted") ) ) { - if ( rZipPackage.getFormat() != PACKAGE_FORMAT ) + if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); sal_Bool bEnc = sal_False; @@ -664,7 +665,7 @@ void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, } else if (aPropertyName.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("EncryptionKey") ) ) { - if ( rZipPackage.getFormat() != PACKAGE_FORMAT ) + if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE ) throw beans::PropertyVetoException( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ), uno::Reference< uno::XInterface >() ); Sequence < sal_Int8 > aNewKey; diff --git a/setup_native/prj/d.lst b/setup_native/prj/d.lst index 9d429454ebba..6aa6460d1823 100644 --- a/setup_native/prj/d.lst +++ b/setup_native/prj/d.lst @@ -1,4 +1,5 @@ mkdir: %_DEST%\bin%_EXT%\osl +mkdir: %_DEST%\bin%_EXT%\broffice ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll ..\%__SRC%\bin\*.exe %_DEST%\bin%_EXT%\*.exe ..\%__SRC%\class\*.jar %_DEST%\bin%_EXT%\*.jar @@ -31,7 +32,15 @@ mkdir: %_DEST%\bin%_EXT%\osolsmf ..\source\linux\*.dat %_DEST%\bin%_EXT%\*.dat ..\source\mac\*.icns %_DEST%\bin%_EXT%\*.icns ..\source\mac\Info.plist.langpack %_DEST%\bin%_EXT%\Info.plist.langpack +..\source\mac\ooo\osxdndinstall.png %_DEST%\bin%_EXT%\osl\osxdndinstall.png +..\source\mac\ooo\osxdndinstall_nologo.png %_DEST%\bin%_EXT%\osl\osxdndinstall_nologo.png +..\source\mac\ooo\DS_Store %_DEST%\bin%_EXT%\osl\DS_Store +..\source\mac\ooo\DS_Store_Langpack %_DEST%\bin%_EXT%\osl\DS_Store_Langpack +..\source\mac\broffice\osxdndinstall.png %_DEST%\bin%_EXT%\broffice\osxdndinstall.png +..\source\mac\broffice\osxdndinstall_nologo.png %_DEST%\bin%_EXT%\broffice\osxdndinstall_nologo.png +..\source\mac\broffice\DS_Store %_DEST%\bin%_EXT%\broffice\DS_Store ..\source\java\openofficeorg_setup.gif %_DEST%\bin%_EXT%\osl\Setup.gif +..\source\java\brofficeorg_setup.gif %_DEST%\bin%_EXT%\broffice\Setup.gif ..\source\java\javaversion.dat %_DEST%\bin%_EXT%\javaversion.dat ..\source\java\javaversion2.dat %_DEST%\bin%_EXT%\javaversion2.dat ..\source\opensolaris\bundledextensions\installed %_DEST%\bin%_EXT%\osolsmf\installed @@ -39,6 +48,7 @@ mkdir: %_DEST%\bin%_EXT%\osolsmf ..\source\opensolaris\bundledextensions\ooo_bundled_extensions.xml %_DEST%\bin%_EXT%\osolsmf\ooo_bundled_extensions.xml ..\source\opensolaris\bundledextensions\svc-ooo_bundled_extensions %_DEST%\bin%_EXT%\osolsmf\svc-ooo_bundled_extensions ..\source\packinfo\solariscopyrightfile %_DEST%\bin%_EXT%\solariscopyrightfile +..\source\packinfo\linuxcopyrightfile %_DEST%\bin%_EXT%\linuxcopyrightfile ..\source\packinfo\*.txt %_DEST%\bin%_EXT%\*.txt ..\source\packinfo\*.pcp %_DEST%\bin%_EXT%\*.pcp ..\scripts\admin.pl %_DEST%\bin%_EXT%\admin.pl diff --git a/setup_native/source/java/brofficeorg_setup.gif b/setup_native/source/java/brofficeorg_setup.gif Binary files differnew file mode 100644 index 000000000000..570d8e462a27 --- /dev/null +++ b/setup_native/source/java/brofficeorg_setup.gif diff --git a/setup_native/source/java/javaversion.dat b/setup_native/source/java/javaversion.dat index 461bd7d6579a..a629a4037269 100755 --- a/setup_native/source/java/javaversion.dat +++ b/setup_native/source/java/javaversion.dat @@ -26,30 +26,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 19 -WINDOWSJAVAVERSION=Java 6 Update 19 +JAVAVERSION=Java 6 Update 20 +WINDOWSJAVAVERSION=Java 6 Update 20 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u19-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_19 +WINDOWSJAVAFILENAME=jre-6u20-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_20 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u19-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u20-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp <filename> ) -LINUXJAVANAME=jre-1.6.0_19-fcs +LINUXJAVANAME=jre-1.6.0_20-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u19-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u20-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_19_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_19_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_19_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_20_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_20_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_20_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_19_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_19_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_19_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_20_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_20_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_20_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt diff --git a/setup_native/source/java/javaversion2.dat b/setup_native/source/java/javaversion2.dat index 461bd7d6579a..a629a4037269 100644 --- a/setup_native/source/java/javaversion2.dat +++ b/setup_native/source/java/javaversion2.dat @@ -26,30 +26,30 @@ #************************************************************************* # GUI String in the installer ("Java Runtime Environment (${JAVAVERSION})") -JAVAVERSION=Java 6 Update 19 -WINDOWSJAVAVERSION=Java 6 Update 19 +JAVAVERSION=Java 6 Update 20 +WINDOWSJAVAVERSION=Java 6 Update 20 # Windows (scp2 and downloadtemplate.nsi) -WINDOWSJAVAFILENAME=jre-6u19-windows-i586.exe -WINDOWSJAVAREGISTRYENTRY=1.6.0_19 +WINDOWSJAVAFILENAME=jre-6u20-windows-i586.exe +WINDOWSJAVAREGISTRYENTRY=1.6.0_20 # Linux (scp2) -LINUXJAVAFILENAME=jre-6u19-linux-i586.rpm +LINUXJAVAFILENAME=jre-6u20-linux-i586.rpm # Linux (rpmUnit.xml, rpm -qp <filename> ) -LINUXJAVANAME=jre-1.6.0_19-fcs +LINUXJAVANAME=jre-1.6.0_20-fcs # Linux-x64 (scp2) -LINUXX64JAVAFILENAME=jre-6u19-linux-amd64.rpm +LINUXX64JAVAFILENAME=jre-6u20-linux-amd64.rpm # Solaris Sparc (scp2) -SOLSJAVARTPACKED=SUNWj6rt_1_6_0_19_sparc.tar.gz -SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_19_sparc.tar.gz -SOLSJAVAMANPACKED=SUNWj6man_1_6_0_19_sparc.tar.gz +SOLSJAVARTPACKED=SUNWj6rt_1_6_0_20_sparc.tar.gz +SOLSJAVACFGPACKED=SUNWj6cfg_1_6_0_20_sparc.tar.gz +SOLSJAVAMANPACKED=SUNWj6man_1_6_0_20_sparc.tar.gz # Solaris x86 (scp2) -SOLIJAVARTPACKED=SUNWj6rt_1_6_0_19_x86.tar.gz -SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_19_x86.tar.gz -SOLIJAVAMANPACKED=SUNWj6man_1_6_0_19_x86.tar.gz +SOLIJAVARTPACKED=SUNWj6rt_1_6_0_20_x86.tar.gz +SOLIJAVACFGPACKED=SUNWj6cfg_1_6_0_20_x86.tar.gz +SOLIJAVAMANPACKED=SUNWj6man_1_6_0_20_x86.tar.gz # Solaris (pkgUnit.xml, needs only to be changed in major changes) SOLARISJAVART=SUNWj6rt diff --git a/setup_native/source/mac/broffice/DS_Store b/setup_native/source/mac/broffice/DS_Store Binary files differnew file mode 100644 index 000000000000..06aad72c93a0 --- /dev/null +++ b/setup_native/source/mac/broffice/DS_Store diff --git a/setup_native/source/mac/broffice/osxdndinstall.png b/setup_native/source/mac/broffice/osxdndinstall.png Binary files differnew file mode 100644 index 000000000000..233d4bbc84b9 --- /dev/null +++ b/setup_native/source/mac/broffice/osxdndinstall.png diff --git a/setup_native/source/mac/broffice/osxdndinstall_nologo.png b/setup_native/source/mac/broffice/osxdndinstall_nologo.png Binary files differnew file mode 100644 index 000000000000..8c5636ec05ca --- /dev/null +++ b/setup_native/source/mac/broffice/osxdndinstall_nologo.png diff --git a/setup_native/source/mac/ooo/DS_Store b/setup_native/source/mac/ooo/DS_Store Binary files differnew file mode 100644 index 000000000000..632e6aff95be --- /dev/null +++ b/setup_native/source/mac/ooo/DS_Store diff --git a/setup_native/source/mac/ooo/DS_Store_Langpack b/setup_native/source/mac/ooo/DS_Store_Langpack Binary files differnew file mode 100644 index 000000000000..1b53eba75b74 --- /dev/null +++ b/setup_native/source/mac/ooo/DS_Store_Langpack diff --git a/setup_native/source/mac/ooo/osxdndinstall.png b/setup_native/source/mac/ooo/osxdndinstall.png Binary files differnew file mode 100644 index 000000000000..7eb5c76649bb --- /dev/null +++ b/setup_native/source/mac/ooo/osxdndinstall.png diff --git a/setup_native/source/mac/ooo/osxdndinstall_nologo.png b/setup_native/source/mac/ooo/osxdndinstall_nologo.png Binary files differnew file mode 100644 index 000000000000..7133e7387ac1 --- /dev/null +++ b/setup_native/source/mac/ooo/osxdndinstall_nologo.png diff --git a/setup_native/source/packinfo/linuxcopyrightfile b/setup_native/source/packinfo/linuxcopyrightfile new file mode 100644 index 000000000000..6e2c0ef08e79 --- /dev/null +++ b/setup_native/source/packinfo/linuxcopyrightfile @@ -0,0 +1,2 @@ +Copyright 2000, 2010 Oracle and/or its affiliates. All rights reserved. +Use is subject to license terms. diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt index 202db8bf640a..f901a248f0b1 100755 --- a/setup_native/source/packinfo/packinfo_office.txt +++ b/setup_native/source/packinfo/packinfo_office.txt @@ -716,6 +716,22 @@ packageversion = "%PACKAGEVERSION" End Start +module = "gid_Module_Root_Extension_Dictionary_Ku_Tr" +script = "shellscripts_extensions.txt" +solarispackagename = "%PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-ku-TR" +solarisrequires = "%SOLSUREPACKAGEPREFIX-ure, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07, %PACKAGEPREFIX%WITHOUTDOTUNIXPRODUCTNAME%BRANDPACKAGEVERSION" +packagename = "%UNIXPRODUCTNAME%BRANDPACKAGEVERSION-dict-ku-TR" +requires = "%UREPACKAGEPREFIX-ure,%BASISPACKAGEPREFIX%OOOBASEVERSION-core01,%BASISPACKAGEPREFIX%OOOBASEVERSION-core02,%BASISPACKAGEPREFIX%OOOBASEVERSION-core03,%BASISPACKAGEPREFIX%OOOBASEVERSION-core04,%BASISPACKAGEPREFIX%OOOBASEVERSION-core05,%BASISPACKAGEPREFIX%OOOBASEVERSION-core06,%BASISPACKAGEPREFIX%OOOBASEVERSION-core07,%UNIXPRODUCTNAME%BRANDPACKAGEVERSION" +linuxpatchrequires = "" +copyright = "1999-2009 by Sun Microsystems" +solariscopyright = "solariscopyrightfile" +vendor = "Sun Microsystems, Inc." +description = "Ku-TR dictionary for %PRODUCTNAME %PRODUCTVERSION" +destpath = "/opt" +packageversion = "%PACKAGEVERSION" +End + +Start module = "gid_Module_Root_Extension_Dictionary_Lt" solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-lt" solarisrequires = "%SOLSUREPACKAGEPREFIX-ure, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTOOOBASEVERSION-core07, %PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index 526058086f67..8d5cb0fc83b8 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -25,6 +25,7 @@ hu = "hu,de-DE,en-US" it = "it,de-DE,en-US,fr" ja = "EMPTY,en-US" ko = "EMPTY,en-US" +ku = "ku-TR,en-US" lt = "lt,en-US" nb = "no,en-US,fr,de-DE,es" ne = "ne,en-US" diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt index 81258d61f38b..5185a9ea642e 100644 --- a/setup_native/source/win32/msi-encodinglist.txt +++ b/setup_native/source/win32/msi-encodinglist.txt @@ -42,7 +42,6 @@ gu 0 1095 # Gujarati gu-IN 0 1095 # Gujarati he 1255 1037 hi 0 1081 -hi-IN 0 1081 # hindi hr 1250 1050 # Croatian hu 1250 1038 hy 0 1067 # Armenian @@ -93,6 +92,7 @@ pt 1252 2070 pt-BR 1252 1046 pt-PT 1252 2070 ps 0 2171 +ca-XV 1252 32771 # Catalan Valencian rm 0 1047 # Raeto-Romance ro 1250 1048 # Romanian ru 1251 1049 diff --git a/setup_native/source/win32/nsis/brobanner.bmp b/setup_native/source/win32/nsis/brobanner.bmp Binary files differindex 37f517176524..7ab14d2a6245 100644 --- a/setup_native/source/win32/nsis/brobanner.bmp +++ b/setup_native/source/win32/nsis/brobanner.bmp diff --git a/setup_native/source/win32/nsis/brobitmap.bmp b/setup_native/source/win32/nsis/brobitmap.bmp Binary files differindex 0c5e11da76d5..f9e9e9b2d44b 100644 --- a/setup_native/source/win32/nsis/brobitmap.bmp +++ b/setup_native/source/win32/nsis/brobitmap.bmp diff --git a/wizards/prj/build.lst b/wizards/prj/build.lst index c98f4561577c..c4d635a921a8 100644 --- a/wizards/prj/build.lst +++ b/wizards/prj/build.lst @@ -1,4 +1,4 @@ -wz wizards : l10n rsc javaunohelper unoil QADEVOOO:qadevOOo NULL +wz wizards : l10n rsc javaunohelper unoil NULL wz wizards\util nmake - all wz_util NULL wz wizards\source\config nmake - all wz_config NULL wz wizards\source\configshare nmake - all wz_configshare NULL diff --git a/wizards/source/formwizard/dbwizres.src b/wizards/source/formwizard/dbwizres.src index 065008c40cec..c04d77b9fcdd 100644 --- a/wizards/source/formwizard/dbwizres.src +++ b/wizards/source/formwizard/dbwizres.src @@ -2856,7 +2856,7 @@ String RID_WEBWIZARDDIALOG_START +110 String RID_WEBWIZARDDIALOG_START +111 { - Text [ en-US ] = "A security error acoccurred while exporting the document '%FILENAME'."; + Text [ en-US ] = "A security error occurred while exporting the document '%FILENAME'."; }; String RID_WEBWIZARDDIALOG_START +112 |