editeng/source/items/paraitem.cxx | 2 filter/inc/filter/msfilter/svdfppt.hxx | 2 filter/source/msfilter/svdfppt.cxx | 2 l10ntools/source/localize.cxx | 1 sc/source/filter/inc/addressconverter.hxx | 16 -- sc/source/filter/inc/biffdetector.hxx | 38 ----- sc/source/filter/inc/biffoutputstream.hxx | 2 sc/source/filter/inc/drawingmanager.hxx | 2 sc/source/filter/inc/excelfilter.hxx | 17 -- sc/source/filter/inc/ooxformulaparser.hxx | 111 ---------------- sc/source/filter/oox/addressconverter.cxx | 29 ---- sc/source/filter/oox/biffdetector.cxx | 81 ----------- sc/source/filter/oox/biffoutputstream.cxx | 8 - sc/source/filter/oox/drawingmanager.cxx | 25 --- sc/source/filter/oox/excelfilter.cxx | 53 ------- sc/source/filter/oox/ooxformulaparser.cxx | 90 ------------ sc/source/filter/oox/sheetdatabuffer.cxx | 75 ---------- sd/source/filter/eppt/epptso.cxx | 4 sd/source/filter/ppt/pptin.cxx | 17 +- svx/source/accessibility/svxrectctaccessiblecontext.cxx | 6 sw/source/core/layout/paintfrm.cxx | 22 +-- unusedcode.easy | 8 - 22 files changed, 48 insertions(+), 563 deletions(-)
New commits: commit 9cab649ccb3d827258e95a9b5c91d4b726564d89 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 27 22:36:52 2012 +0100 Resolves: fdo#47865 insertions into deque invalidate nLastCount diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 286908a..beb44dd 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -191,9 +191,9 @@ public: class SwLineRects : public std::deque< SwLineRect > { - std::deque< SwLineRect >::iterator nLastCount; //avoid unnecessary cycles in PaintLines + size_t nLastCount; //avoid unnecessary cycles in PaintLines public: - SwLineRects() : nLastCount( this->begin() ) {} + SwLineRects() : nLastCount( 0 ) {} void AddLineRect( const SwRect& rRect, const Color *pColor, const SvxBorderStyle nStyle, const SwTabFrm *pTab, const sal_uInt8 nSCol ); void ConnectEdges( OutputDevice *pOut ); @@ -827,7 +827,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) { // Paint the borders. Sadly two passes are needed. // Once for the inside and once for the outside edges of tables - if ( this->end() != nLastCount ) + if ( this->size() != nLastCount ) { // #i16816# tagged pdf support SwTaggedPDFHelper aTaggedPDFHelper( 0, 0, 0, *pOut ); @@ -839,18 +839,18 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) const Color *pLast = 0; sal_Bool bPaint2nd = sal_False; - SwLineRects::iterator nMinCount = this->end(); + size_t nMinCount = this->size(); - for (SwLineRects::iterator it = this->begin(); it != this->end(); ++it) + for ( size_t i = 0; i < size(); ++i ) { - SwLineRect &rLRect = *it; + SwLineRect &rLRect = operator[](i); if ( rLRect.IsPainted() ) continue; if ( rLRect.IsLocked() ) { - nMinCount = Min( nMinCount, it ); + nMinCount = Min( nMinCount, i ); continue; } @@ -905,15 +905,16 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) bPaint2nd = sal_True; } if ( bPaint2nd ) - for (SwLineRects::iterator it = this->begin(); it != this->end(); ++it) + { + for ( size_t i = 0; i < size(); ++i ) { - SwLineRect &rLRect = *it; + SwLineRect &rLRect = operator[](i); if ( rLRect.IsPainted() ) continue; if ( rLRect.IsLocked() ) { - nMinCount = Min( nMinCount, it ); + nMinCount = Min( nMinCount, i ); continue; } @@ -935,6 +936,7 @@ void SwLineRects::PaintLines( OutputDevice *pOut ) lcl_DrawDashedRect( pOut, rLRect ); rLRect.SetPainted(); } + } nLastCount = nMinCount; pOut->Pop(); } commit 919f7104b51b156db34787eb7bd5f16e4ecfb633 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 27 22:02:36 2012 +0100 drop intermediate temporary UniStrings diff --git a/editeng/source/items/paraitem.cxx b/editeng/source/items/paraitem.cxx index d7736d1..b1ab1fd 100644 --- a/editeng/source/items/paraitem.cxx +++ b/editeng/source/items/paraitem.cxx @@ -887,7 +887,7 @@ XubString SvxTabStop::GetValueString() const XubString aStr; aStr += sal_Unicode( '(' ); - aStr += UniString::CreateFromInt32(nTabPos); + aStr += rtl::OUString::valueOf(static_cast<sal_Int32>(nTabPos)); aStr += cpDelim; aStr += XubString( EditResId( RID_SVXITEMS_TAB_ADJUST_BEGIN + (sal_uInt16)eAdjustment ) ); diff --git a/filter/inc/filter/msfilter/svdfppt.hxx b/filter/inc/filter/msfilter/svdfppt.hxx index f1ac113..8a6d1ed 100644 --- a/filter/inc/filter/msfilter/svdfppt.hxx +++ b/filter/inc/filter/msfilter/svdfppt.hxx @@ -423,7 +423,7 @@ protected: sal_Bool bTimesNewRomanChecked : 1; sal_Bool bTimesNewRomanAvailable : 1; - sal_Bool ReadString( String& rStr ) const; + sal_Bool ReadString( rtl::OUString& rStr ) const; // nur fuer PowerPoint-Filter: virtual const PptSlideLayoutAtom* GetSlideLayoutAtom() const; diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx index 1df7ffb..9e4d709 100644 --- a/filter/source/msfilter/svdfppt.cxx +++ b/filter/source/msfilter/svdfppt.cxx @@ -547,7 +547,7 @@ const PptSlideLayoutAtom* SdrEscherImport::GetSlideLayoutAtom() const return NULL; } -sal_Bool SdrEscherImport::ReadString( String& rStr ) const +sal_Bool SdrEscherImport::ReadString( rtl::OUString& rStr ) const { sal_Bool bRet = sal_False; DffRecordHeader aStrHd; diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 6eec4bf..6841e54 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -1232,7 +1232,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u if ( pIter != maSlideNameList.end() ) { nPageIndex = pIter - maSlideNameList.begin(); - aPageUrl = UniString::CreateFromInt32( 256 + nPageIndex ); + aPageUrl = rtl::OUString::valueOf(static_cast<sal_Int32>(256 + nPageIndex)); aPageUrl.Append( String( RTL_CONSTASCII_USTRINGPARAM( "," ) ) ); aPageUrl.Append( String::CreateFromInt32( nPageIndex + 1 ) ); aPageUrl.Append( String( RTL_CONSTASCII_USTRINGPARAM( ",Slide " ) ) ); @@ -2057,7 +2057,7 @@ void PPTWriter::ImplWriteClickAction( SvStream& rSt, ::com::sun::star::presentat nHyperLinkType = 7; String aEmpty; - String aHyperString = UniString::CreateFromInt32( 256 + nIndex ); + String aHyperString = rtl::OUString::valueOf(static_cast<sal_Int32>(256 + nIndex)); aHyperString.Append( String( RTL_CONSTASCII_USTRINGPARAM( "," ) ) ); aHyperString.Append( String::CreateFromInt32( nIndex + 1 ) ); aHyperString.Append( String( RTL_CONSTASCII_USTRINGPARAM( ",Slide " ) ) ); diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 069af5b..147813b 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -1266,7 +1266,7 @@ sal_Bool ImplSdPPTImport::Import() DffRecordHeader aContent; if ( SeekToRec( rStCtrl, PPT_PST_CString, aCuHeader.GetRecEndFilePos(), &aContent ) ) { - String aCuShow; + rtl::OUString aCuShow; aContent.SeekToBegOfRecord( rStCtrl ); if ( ReadString( aCuShow ) ) { @@ -1868,7 +1868,7 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const sal_Bool bNewAnimat String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const { - String aRetval; + rtl::OUString aRetval; sal_uInt32 nPosMerk = rStCtrl.Tell(); DffRecordHeader aDocHd; if ( SeekToDocument( &aDocHd ) ) @@ -1885,7 +1885,7 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const while( !bDone && SeekToRec( rStCtrl, PPT_PST_Sound, nDataLen, &aSoundRecHd ) ) { sal_uInt32 nStrLen = aSoundRecHd.GetRecEndFilePos(); - String aRefStr; + rtl::OUString aRefStr; sal_uInt32 nPosMerk2 = rStCtrl.Tell(); if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, NULL, 2 ) ) { @@ -1894,7 +1894,7 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const } if ( bRefStrValid ) { - if ( UniString::CreateFromInt32( nSoundRef ) == aRefStr ) + if ( rtl::OUString::valueOf(static_cast<sal_Int32>(nSoundRef)) == aRefStr ) { rStCtrl.Seek( nPosMerk2 ); if ( SeekToRec( rStCtrl, PPT_PST_CString, nStrLen, NULL, 0 ) ) @@ -1915,12 +1915,11 @@ String ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const GalleryExplorer::FillObjList( GALLERY_THEME_SOUNDS, aSoundList ); GalleryExplorer::FillObjList( GALLERY_THEME_USERSOUNDS, aSoundList ); - for( size_t n = 0; ( n < aSoundList.size() ) && !bSoundExists; n++ ) + for( size_t n = 0; ( n < aSoundList.size() ) && !bSoundExists; ++n ) { INetURLObject aURL( aSoundList[ n ] ); - String aSoundName( aURL.GetName() ); - if( aSoundName == aRetval ) + if( aURL.GetName() == aRetval ) { aRetval = aSoundList[ n ]; bSoundExists = sal_True; @@ -2013,7 +2012,7 @@ String ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const case PPT_PST_CString : { aHd.SeekToBegOfRecord( rStCtrl ); - String aStr; + rtl::OUString aStr; if ( ReadString( aStr ) ) { if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( aStr, aRetVal ) ) @@ -2622,7 +2621,7 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi case PPT_PST_InteractiveInfo: { sal_uInt32 nFilePosMerk2 = rSt.Tell(); - String aMacroName; + rtl::OUString aMacroName; if(SeekToRec( rSt, PPT_PST_CString, nHdRecEnd, NULL, 0 ) ) ReadString(aMacroName); diff --git a/svx/source/accessibility/svxrectctaccessiblecontext.cxx b/svx/source/accessibility/svxrectctaccessiblecontext.cxx index ab5c4bb..a15410e 100644 --- a/svx/source/accessibility/svxrectctaccessiblecontext.cxx +++ b/svx/source/accessibility/svxrectctaccessiblecontext.cxx @@ -300,10 +300,8 @@ Reference< XAccessible > SAL_CALL SvxRectCtlAccessibleContext::getAccessibleChil if( !xChild.is() ) { const ChildIndexToPointData* p = IndexToPoint( nIndex, mbAngleMode ); - UniString tmp = SVX_RESSTR( p->nResIdName ); - ::rtl::OUString aName( tmp ); - tmp = SVX_RESSTR( p->nResIdDescr ); - ::rtl::OUString aDescr( tmp ); + ::rtl::OUString aName(SVX_RESSTR(p->nResIdName)); + ::rtl::OUString aDescr(SVX_RESSTR(p->nResIdDescr)); Rectangle aFocusRect( mpRepr->CalculateFocusRectangle( p->ePoint ) ); commit 887d7945addeb823e0d3f783609c4e79d92ad4a7 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 27 21:40:57 2012 +0100 callcatcher: update list diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx index 3d2934d..3b0d5dd 100644 --- a/sc/source/filter/inc/addressconverter.hxx +++ b/sc/source/filter/inc/addressconverter.hxx @@ -72,7 +72,6 @@ struct BinAddress void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); - void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; }; // ---------------------------------------------------------------------------- @@ -99,12 +98,6 @@ inline BiffInputStream& operator>>( BiffInputStream& rStrm, BinAddress& orPos ) return rStrm; } -inline BiffOutputStream& operator<<( BiffOutputStream& rStrm, const BinAddress& rPos ) -{ - rPos.write( rStrm ); - return rStrm; -} - // ============================================================================ /** A 2D cell range address struct for binary filters. */ @@ -179,9 +172,6 @@ public: void read( SequenceInputStream& rStrm ); void read( BiffInputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ); - void write( BiffOutputStream& rStrm, bool bCol16Bit = true, bool bRow32Bit = false ) const; - void writeSubList( BiffOutputStream& rStrm, - size_t nBegin, size_t nCount, bool bCol16Bit = true, bool bRow32Bit = false ) const; }; // ---------------------------------------------------------------------------- @@ -198,12 +188,6 @@ inline BiffInputStream& operator>>( BiffInputStream& rStrm, BinRangeList& orRang return rStrm; } -inline BiffOutputStream& operator<<( BiffOutputStream& rStrm, const BinRangeList& rRanges ) -{ - rRanges.write( rStrm ); - return rStrm; -} - // ============================================================================ /** Different target types that can be encoded in a BIFF URL. */ diff --git a/sc/source/filter/inc/biffdetector.hxx b/sc/source/filter/inc/biffdetector.hxx index 5a7c330..b75c912 100644 --- a/sc/source/filter/inc/biffdetector.hxx +++ b/sc/source/filter/inc/biffdetector.hxx @@ -48,46 +48,14 @@ namespace xls { // ============================================================================ /** Detection service for BIFF streams or storages. */ -class BiffDetector : public ::cppu::WeakImplHelper2< - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XExtendedFilterDetection > +namespace BiffDetector { -public: - explicit BiffDetector( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) - throw( ::com::sun::star::uno::RuntimeException ); - - virtual ~BiffDetector(); - /** Detects the BIFF version of the passed stream. */ - static BiffType detectStreamBiffVersion( BinaryInputStream& rInStream ); + BiffType detectStreamBiffVersion( BinaryInputStream& rInStream ); /** Detects the BIFF version and workbook stream name of the passed storage. */ - static BiffType detectStorageBiffVersion( - ::rtl::OUString& orWorkbookStreamName, + BiffType detectStorageBiffVersion( ::rtl::OUString& orWorkbookStreamName, const StorageRef& rxStorage ); - - // com.sun.star.lang.XServiceInfo interface ------------------------------- - - virtual ::rtl::OUString SAL_CALL - getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); - - virtual sal_Bool SAL_CALL - supportsService( const ::rtl::OUString& rService ) - throw( ::com::sun::star::uno::RuntimeException ); - - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - - // com.sun.star.document.XExtendedFilterDetect interface ------------------ - - virtual ::rtl::OUString SAL_CALL - detect( ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& orDescriptor ) - throw( ::com::sun::star::uno::RuntimeException ); - -private: - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > - mxContext; }; // ============================================================================ diff --git a/sc/source/filter/inc/biffoutputstream.hxx b/sc/source/filter/inc/biffoutputstream.hxx index 45ae4d8..9f9d7d6 100644 --- a/sc/source/filter/inc/biffoutputstream.hxx +++ b/sc/source/filter/inc/biffoutputstream.hxx @@ -62,8 +62,6 @@ public: /** Writes nBytes bytes from the existing buffer pData. Must NOT overwrite the destination buffer. */ void write( const void* pData, sal_uInt16 nBytes ); - /** Writes a sequence of nBytes bytes with the passed value. */ - void fill( sal_uInt8 nValue, sal_uInt16 nBytes ); private: typedef ::std::vector< sal_uInt8 > DataBuffer; diff --git a/sc/source/filter/inc/drawingmanager.hxx b/sc/source/filter/inc/drawingmanager.hxx index f2f018e..b80d79f 100644 --- a/sc/source/filter/inc/drawingmanager.hxx +++ b/sc/source/filter/inc/drawingmanager.hxx @@ -163,8 +163,6 @@ protected: void readMacroBiff4( BiffInputStream& rStrm, sal_uInt16 nMacroSize ); /** Reads the macro link in a BIFF5 OBJ record. */ void readMacroBiff5( BiffInputStream& rStrm, sal_uInt16 nMacroSize ); - /** Reads the contents of the ftMacro sub structure in an OBJ record. */ - void readMacroBiff8( BiffInputStream& rStrm ); /** Converts the passed line formatting to the passed property map. */ void convertLineProperties( ::oox::drawingml::ShapePropertyMap& rPropMap, const BiffObjLineModel& rLineModel, sal_uInt16 nArrows = 0 ) const; diff --git a/sc/source/filter/inc/excelfilter.hxx b/sc/source/filter/inc/excelfilter.hxx index c15b6cc..38d702d 100644 --- a/sc/source/filter/inc/excelfilter.hxx +++ b/sc/source/filter/inc/excelfilter.hxx @@ -100,23 +100,6 @@ private: virtual ::rtl::OUString implGetImplementationName() const; }; -// ============================================================================ - -class ExcelVbaProjectFilter : public ExcelBiffFilter -{ -public: - explicit ExcelVbaProjectFilter( - const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext ) - throw( ::com::sun::star::uno::RuntimeException ); - - virtual bool importDocument() throw(); - virtual bool exportDocument() throw(); - -private: - virtual ::rtl::OUString implGetImplementationName() const; -}; - // ============================================================================ - } // namespace xls } // namespace oox diff --git a/sc/source/filter/inc/ooxformulaparser.hxx b/sc/source/filter/inc/ooxformulaparser.hxx deleted file mode 100644 index 757aec6..0000000 --- a/sc/source/filter/inc/ooxformulaparser.hxx +++ /dev/null @@ -1,111 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef OOX_XLS_OOXFORMULAPARSER_HXX -#define OOX_XLS_OOXFORMULAPARSER_HXX - -#include <boost/shared_ptr.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/lang/XInitialization.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> -#include <com/sun/star/sheet/XFilterFormulaParser.hpp> -#include <cppuhelper/implbase3.hxx> - -namespace oox { -namespace xls { - -class OOXMLFormulaParserImpl; - -// ============================================================================ - -typedef ::cppu::WeakImplHelper3< - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::lang::XInitialization, - ::com::sun::star::sheet::XFilterFormulaParser > OOXMLFormulaParser_BASE; - -/** OOXML formula parser/compiler service for usage in ODF filters. */ -class OOXMLFormulaParser : public OOXMLFormulaParser_BASE -{ -public: - explicit OOXMLFormulaParser(); - virtual ~OOXMLFormulaParser(); - - // com.sun.star.lang.XServiceInfo interface ------------------------------- - - virtual ::rtl::OUString SAL_CALL - getImplementationName() throw( ::com::sun::star::uno::RuntimeException ); - - virtual sal_Bool SAL_CALL - supportsService( const ::rtl::OUString& rService ) - throw( ::com::sun::star::uno::RuntimeException ); - - virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL - getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException ); - - // com.sun.star.lang.XInitialization interface ---------------------------- - - virtual void SAL_CALL initialize( - const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& rArgs ) - throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException ); - - // com.sun.star.sheet.XFilterFormulaParser interface ---------------------- - - virtual ::rtl::OUString SAL_CALL - getSupportedNamespace() - throw( ::com::sun::star::uno::RuntimeException ); - - // com.sun.star.sheet.XFormulaParser interface ---------------------------- - - virtual ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken > SAL_CALL - parseFormula( - const ::rtl::OUString& rFormula, - const ::com::sun::star::table::CellAddress& rReferencePos ) - throw( ::com::sun::star::uno::RuntimeException ); - - virtual ::rtl::OUString SAL_CALL - printFormula( - const ::com::sun::star::uno::Sequence< ::com::sun::star::sheet::FormulaToken >& rTokens, - const ::com::sun::star::table::CellAddress& rReferencePos ) - throw( ::com::sun::star::uno::RuntimeException ); - -private: - typedef ::boost::shared_ptr< OOXMLFormulaParserImpl > ParserImplRef; - - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > - mxComponent; - ParserImplRef mxParserImpl; /// Implementation of import parser. -}; - -// ============================================================================ - -} // namespace xls -} // namespace oox - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx index e566f07..d46ff07 100644 --- a/sc/source/filter/oox/addressconverter.cxx +++ b/sc/source/filter/oox/addressconverter.cxx @@ -134,18 +134,6 @@ void BinAddress::read( BiffInputStream& rStrm, bool bCol16Bit, bool bRow32Bit ) mnCol = bCol16Bit ? rStrm.readuInt16() : rStrm.readuInt8(); } -void BinAddress::write( BiffOutputStream& rStrm, bool bCol16Bit, bool bRow32Bit ) const -{ - if( bRow32Bit ) - rStrm << mnRow; - else - rStrm << static_cast< sal_uInt16 >( mnRow ); - if( bCol16Bit ) - rStrm << static_cast< sal_uInt16 >( mnCol ); - else - rStrm << static_cast< sal_uInt8 >( mnCol ); -} - // ============================================================================ void BinRange::read( SequenceInputStream& rStrm ) @@ -191,23 +179,6 @@ void BinRangeList::read( BiffInputStream& rStrm, bool bCol16Bit, bool bRow32Bit aIt->read( rStrm, bCol16Bit, bRow32Bit ); } -void BinRangeList::write( BiffOutputStream& rStrm, bool bCol16Bit, bool bRow32Bit ) const -{ - writeSubList( rStrm, 0, size(), bCol16Bit, bRow32Bit ); -} - -void BinRangeList::writeSubList( BiffOutputStream& rStrm, size_t nBegin, size_t nCount, bool bCol16Bit, bool bRow32Bit ) const -{ - OSL_ENSURE( nBegin <= size(), "BiffRangeList::writeSubList - invalid start position" ); - size_t nEnd = ::std::min< size_t >( nBegin + nCount, size() ); - sal_uInt16 nBiffCount = getLimitedValue< sal_uInt16, size_t >( nEnd - nBegin, 0, SAL_MAX_UINT16 ); - rStrm << nBiffCount; - rStrm.setPortionSize( lclGetBiffRangeSize( bCol16Bit, bRow32Bit ) ); - for( const_iterator aIt = begin() + nBegin, aEnd = begin() + nEnd; aIt != aEnd; ++aIt ) - aIt->write( rStrm, bCol16Bit, bRow32Bit ); -} - -// ============================================================================ // ============================================================================ AddressConverter::AddressConverter( const WorkbookHelper& rHelper ) : diff --git a/sc/source/filter/oox/biffdetector.cxx b/sc/source/filter/oox/biffdetector.cxx index b099ad2..cf29f62 100644 --- a/sc/source/filter/oox/biffdetector.cxx +++ b/sc/source/filter/oox/biffdetector.cxx @@ -38,6 +38,7 @@ namespace oox { namespace xls { +namespace BiffDetector { // ============================================================================ @@ -50,32 +51,7 @@ using ::comphelper::MediaDescriptor; using ::rtl::OStringBuffer; using ::rtl::OUString; -// ============================================================================ - -Sequence< OUString > BiffDetector_getSupportedServiceNames() -{ - Sequence< OUString > aServiceNames( 1 ); - aServiceNames[ 0 ] = CREATE_OUSTRING( "com.sun.star.frame.ExtendedTypeDetection" ); - return aServiceNames; -} - -OUString BiffDetector_getImplementationName() -{ - return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.BiffDetector" ); -} - -// ============================================================================ - -BiffDetector::BiffDetector( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : - mxContext( rxContext, UNO_SET_THROW ) -{ -} - -BiffDetector::~BiffDetector() -{ -} - -/*static*/ BiffType BiffDetector::detectStreamBiffVersion( BinaryInputStream& rInStream ) +BiffType detectStreamBiffVersion( BinaryInputStream& rInStream ) { BiffType eBiff = BIFF_UNKNOWN; if( !rInStream.isEof() && rInStream.isSeekable() && (rInStream.size() > 4) ) @@ -127,10 +103,8 @@ BiffDetector::~BiffDetector() return eBiff; } -/*static*/ BiffType BiffDetector::detectStorageBiffVersion( OUString& orWorkbookStreamName, const StorageRef& rxStorage ) +BiffType detectStorageBiffVersion( OUString& orWorkbookStreamName, const StorageRef& rxStorage ) { - static const OUString saBookName = CREATE_OUSTRING( "Book" ); - static const OUString saWorkbookName = CREATE_OUSTRING( "Workbook" ); BiffType eBiff = BIFF_UNKNOWN; if( rxStorage.get() ) @@ -138,10 +112,12 @@ BiffDetector::~BiffDetector() if( rxStorage->isStorage() ) { // try to open the "Book" stream + const OUString saBookName = CREATE_OUSTRING( "Book" ); BinaryXInputStream aBookStrm5( rxStorage->openInputStream( saBookName ), true ); BiffType eBookStrm5Biff = detectStreamBiffVersion( aBookStrm5 ); // try to open the "Workbook" stream + const OUString saWorkbookName = CREATE_OUSTRING( "Workbook" ); BinaryXInputStream aBookStrm8( rxStorage->openInputStream( saWorkbookName ), true ); BiffType eBookStrm8Biff = detectStreamBiffVersion( aBookStrm8 ); @@ -173,54 +149,9 @@ BiffDetector::~BiffDetector() return eBiff; } -// com.sun.star.lang.XServiceInfo interface ----------------------------------- - -OUString SAL_CALL BiffDetector::getImplementationName() throw( RuntimeException ) -{ - return BiffDetector_getImplementationName(); -} - -sal_Bool SAL_CALL BiffDetector::supportsService( const OUString& rService ) throw( RuntimeException ) -{ - const Sequence< OUString > aServices = BiffDetector_getSupportedServiceNames(); - const OUString* pArray = aServices.getConstArray(); - const OUString* pArrayEnd = pArray + aServices.getLength(); - return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd; -} - -Sequence< OUString > SAL_CALL BiffDetector::getSupportedServiceNames() throw( RuntimeException ) -{ - return BiffDetector_getSupportedServiceNames(); -} - -// com.sun.star.document.XExtendedFilterDetect interface ---------------------- - -OUString SAL_CALL BiffDetector::detect( Sequence< PropertyValue >& rDescriptor ) throw( RuntimeException ) -{ - OUString aTypeName; - - MediaDescriptor aDescriptor( rDescriptor ); - aDescriptor.addInputStream(); - - Reference< XInputStream > xInStrm( aDescriptor[ MediaDescriptor::PROP_INPUTSTREAM() ], UNO_QUERY_THROW ); - StorageRef xStorage( new ::oox::ole::OleStorage( mxContext, xInStrm, true ) ); - - OUString aWorkbookName; - switch( detectStorageBiffVersion( aWorkbookName, xStorage ) ) - { - case BIFF2: - case BIFF3: - case BIFF4: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_40" ); break; - case BIFF5: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_95" ); break; - case BIFF8: aTypeName = CREATE_OUSTRING( "calc_MS_Excel_97" ); break; - default:; - } - - return aTypeName; -} - // ============================================================================ +} // BiffDetector } // namespace xls } // namespace oox diff --git a/sc/source/filter/oox/biffoutputstream.cxx b/sc/source/filter/oox/biffoutputstream.cxx index f4d24fe..0af0a20 100644 --- a/sc/source/filter/oox/biffoutputstream.cxx +++ b/sc/source/filter/oox/biffoutputstream.cxx @@ -73,14 +73,6 @@ void BiffOutputRecordBuffer::write( const void* pData, sal_uInt16 nBytes ) memcpy( &*(maData.end() - nBytes), pData, nBytes ); } -void BiffOutputRecordBuffer::fill( sal_uInt8 nValue, sal_uInt16 nBytes ) -{ - OSL_ENSURE( mbInRec, "BiffOutputRecordBuffer::write - no record open" ); - OSL_ENSURE( nBytes > 0, "BiffOutputRecordBuffer::write - nothing to write" ); - OSL_ENSURE( nBytes <= getRecLeft(), "BiffOutputRecordBuffer::write - buffer overflow" ); - maData.resize( maData.size() + nBytes, nValue ); -} - } // namespace prv // ============================================================================ diff --git a/sc/source/filter/oox/drawingmanager.cxx b/sc/source/filter/oox/drawingmanager.cxx index a50e805..8a1754a 100644 --- a/sc/source/filter/oox/drawingmanager.cxx +++ b/sc/source/filter/oox/drawingmanager.cxx @@ -444,31 +444,6 @@ void BiffDrawingObjectBase::readMacroBiff5( BiffInputStream& rStrm, sal_uInt16 n rStrm.skip( nMacroSize ); } -void BiffDrawingObjectBase::readMacroBiff8( BiffInputStream& rStrm ) -{ - maMacroName = OUString(); - if( rStrm.getRemaining() > 6 ) - { - // macro is stored in a tNameXR token containing a link to a defined name - sal_uInt16 nFmlaSize; - rStrm >> nFmlaSize; - rStrm.skip( 4 ); - OSL_ENSURE( nFmlaSize == 7, "BiffDrawingObjectBase::readMacroBiff8 - unexpected formula size" ); - if( nFmlaSize == 7 ) - { - sal_uInt8 nTokenId; - sal_uInt16 nExtLinkId, nExtNameId; - rStrm >> nTokenId >> nExtLinkId >> nExtNameId; -#if 0 - OSL_ENSURE( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ), - "BiffDrawingObjectBase::readMacroBiff8 - tNameXR token expected" ); - if( nTokenId == XclTokenArrayHelper::GetTokenId( EXC_TOKID_NAMEX, EXC_TOKCLASS_REF ) ) - maMacroName = GetLinkManager().GetMacroName( nExtLinkId, nExtNameId ); -#endif - } - } -} - void BiffDrawingObjectBase::convertLineProperties( ShapePropertyMap& rPropMap, const BiffObjLineModel& rLineModel, sal_uInt16 nArrows ) const { if( rLineModel.mbAuto ) diff --git a/sc/source/filter/oox/excelfilter.cxx b/sc/source/filter/oox/excelfilter.cxx index 08f3ec6..f5a8b4d 100644 --- a/sc/source/filter/oox/excelfilter.cxx +++ b/sc/source/filter/oox/excelfilter.cxx @@ -274,59 +274,6 @@ OUString ExcelBiffFilter::implGetImplementationName() const return ExcelBiffFilter_getImplementationName(); } -// ============================================================================ - -OUString SAL_CALL ExcelVbaProjectFilter_getImplementationName() throw() -{ - return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.ExcelVbaProjectFilter" ); -} - -// ---------------------------------------------------------------------------- - -ExcelVbaProjectFilter::ExcelVbaProjectFilter( const Reference< XComponentContext >& rxContext ) throw( RuntimeException ) : - ExcelBiffFilter( rxContext ) -{ -} - -bool ExcelVbaProjectFilter::importDocument() throw() -{ - // detect BIFF version and workbook stream name - OUString aWorkbookName; - BiffType eBiff = BiffDetector::detectStorageBiffVersion( aWorkbookName, getStorage() ); - OSL_ENSURE( eBiff == BIFF8, "ExcelVbaProjectFilter::ExcelVbaProjectFilter - invalid file format" ); - if( eBiff != BIFF8 ) - return false; - - StorageRef xVbaPrjStrg = openSubStorage( CREATE_OUSTRING( "_VBA_PROJECT_CUR" ), false ); - if( !xVbaPrjStrg || !xVbaPrjStrg->isStorage() ) - return false; - - /* Construct the WorkbookGlobals object referred to by every instance of - the class WorkbookHelper. */ - WorkbookGlobalsRef xBookGlob = WorkbookHelper::constructGlobals( *this, eBiff ); - if( !xBookGlob.get() ) - return false; - - // set palette colors passed in service constructor - Any aPalette = getArgument( CREATE_OUSTRING( "ColorPalette" ) ); - WorkbookHelper( *xBookGlob ).getStyles().importPalette( aPalette ); - // import the VBA project (getVbaProject() implemented in base class) - getVbaProject().importVbaProject( *xVbaPrjStrg, getGraphicHelper() ); - return true; -} - -bool ExcelVbaProjectFilter::exportDocument() throw() -{ - return false; -} - -OUString ExcelVbaProjectFilter::implGetImplementationName() const -{ - return ExcelVbaProjectFilter_getImplementationName(); -} - -// ============================================================================ - } // namespace xls } // namespace oox diff --git a/sc/source/filter/oox/ooxformulaparser.cxx b/sc/source/filter/oox/ooxformulaparser.cxx index ab2f515..c0739c5 100644 --- a/sc/source/filter/oox/ooxformulaparser.cxx +++ b/sc/source/filter/oox/ooxformulaparser.cxx @@ -26,7 +26,12 @@ * ************************************************************************/ -#include "ooxformulaparser.hxx" +#include <boost/shared_ptr.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/sheet/XFilterFormulaParser.hpp> +#include <cppuhelper/implbase3.hxx> #include <com/sun/star/uno/XComponentContext.hpp> #include "formulaparser.hxx" @@ -111,89 +116,6 @@ const FunctionInfo* OOXMLFormulaParserImpl::resolveBadFuncName( const OUString& return 0; } -// ============================================================================ - -Sequence< OUString > OOXMLFormulaParser_getSupportedServiceNames() -{ - Sequence< OUString > aServiceNames( 1 ); - aServiceNames[ 0 ] = CREATE_OUSTRING( "com.sun.star.sheet.FilterFormulaParser" ); - return aServiceNames; -} - -OUString OOXMLFormulaParser_getImplementationName() -{ - return CREATE_OUSTRING( "com.sun.star.comp.oox.xls.FormulaParser" ); -} - -// ============================================================================ - -OOXMLFormulaParser::OOXMLFormulaParser() -{ -} - -OOXMLFormulaParser::~OOXMLFormulaParser() -{ -} - -// com.sun.star.lang.XServiceInfo interface ----------------------------------- - -OUString SAL_CALL OOXMLFormulaParser::getImplementationName() throw( RuntimeException ) -{ - return OOXMLFormulaParser_getImplementationName(); -} - -sal_Bool SAL_CALL OOXMLFormulaParser::supportsService( const OUString& rService ) throw( RuntimeException ) -{ - const Sequence< OUString > aServices( OOXMLFormulaParser_getSupportedServiceNames() ); - const OUString* pArray = aServices.getConstArray(); - const OUString* pArrayEnd = pArray + aServices.getLength(); - return ::std::find( pArray, pArrayEnd, rService ) != pArrayEnd; -} - -Sequence< OUString > SAL_CALL OOXMLFormulaParser::getSupportedServiceNames() throw( RuntimeException ) -{ - return OOXMLFormulaParser_getSupportedServiceNames(); -} - -// com.sun.star.lang.XInitialization interface -------------------------------- - -void SAL_CALL OOXMLFormulaParser::initialize( const Sequence< Any >& rArgs ) throw( Exception, RuntimeException ) -{ - OSL_ENSURE( rArgs.hasElements(), "OOXMLFormulaParser::initialize - missing arguments" ); - if( !rArgs.hasElements() ) - throw RuntimeException(); - mxComponent.set( rArgs[ 0 ], UNO_QUERY_THROW ); -} - -// com.sun.star.sheet.XFilterFormulaParser interface -------------------------- - -OUString SAL_CALL OOXMLFormulaParser::getSupportedNamespace() throw( RuntimeException ) -{ - return CREATE_OUSTRING( "http://schemas.microsoft.com/office/excel/formula" ); -} - -// com.sun.star.sheet.XFormulaParser interface -------------------------------- - -Sequence< FormulaToken > SAL_CALL OOXMLFormulaParser::parseFormula( - const OUString& rFormula, const CellAddress& rReferencePos ) throw( RuntimeException ) -{ - if( !mxParserImpl ) - { - Reference< XMultiServiceFactory > xModelFactory( mxComponent, UNO_QUERY_THROW ); - mxParserImpl.reset( new OOXMLFormulaParserImpl( xModelFactory ) ); - } - return mxParserImpl->parseFormula( rFormula, rReferencePos ); -} - -OUString SAL_CALL OOXMLFormulaParser::printFormula( - const Sequence< FormulaToken >& /*rTokens*/, const CellAddress& /*rReferencePos*/ ) throw( RuntimeException ) -{ - // not implemented - throw RuntimeException(); -} - -// ============================================================================ - } // namespace xls } // namespace oox diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx b/sc/source/filter/oox/sheetdatabuffer.cxx index 561083a..3b15243 100644 --- a/sc/source/filter/oox/sheetdatabuffer.cxx +++ b/sc/source/filter/oox/sheetdatabuffer.cxx @@ -204,80 +204,9 @@ void CellBlockBuffer::setColSpans( sal_Int32 nRow, const ValueRangeSet& rColSpan CellBlock* CellBlockBuffer::getCellBlock( const CellAddress& rCellAddr ) { - (void) rCellAddr; // Avoid WaE: unreferenced formal parameter, drop this line - // if the below "temporarily disabled" early return is removed - - // Temporarily disabled. TODO: Fix this. + (void) rCellAddr; + // TODO: Fix this. return NULL; - -#if 0 // Avoid WaE: unreachable code. Don't remove this ifdeffed out block, see above - OSL_ENSURE( rCellAddr.Row >= mnCurrRow, "CellBlockBuffer::getCellBlock - passed row out of order" ); - // prepare cell blocks, if row changes - if( rCellAddr.Row != mnCurrRow ) - { - // find colspans for the new row - ColSpanVectorMap::iterator aIt = maColSpans.find( rCellAddr.Row ); - - /* Gap between rows, or rows out of order, or no colspan - information for the new row found: flush all open cell blocks. */ - if( (aIt == maColSpans.end()) || (rCellAddr.Row != mnCurrRow + 1) ) - { - finalizeImport(); - maCellBlocks.clear(); - maCellBlockIt = maCellBlocks.end(); - } - - /* Prepare matching cell blocks, create new cell blocks, finalize - unmatching cell blocks, if colspan information is available. */ - if( aIt != maColSpans.end() ) - { - /* The colspan vector aIt points to is sorted by columns, as well - as the cell block map. In the folloing, this vector and the - list of cell blocks can be iterated simultanously. */ - CellBlockMap::iterator aMIt = maCellBlocks.begin(); - const ValueRangeVector& rColRanges = aIt->second; - for( ValueRangeVector::const_iterator aVIt = rColRanges.begin(), aVEnd = rColRanges.end(); aVIt != aVEnd; ++aVIt, ++aMIt ) - { - const ValueRange& rColSpan = *aVIt; - /* Finalize and remove all cell blocks up to end of the column - range (cell blocks are keyed by end column index). */ - while( (aMIt != maCellBlocks.end()) && aMIt->second->isBefore( rColSpan ) ) - { - aMIt->second->finalizeImport(); - maCellBlocks.erase( aMIt++ ); - } - /* If the current cell block (aMIt) fits to the colspan, start - a new row there, otherwise create and insert a new cell block. */ - if( (aMIt != maCellBlocks.end()) && aMIt->second->isExpandable( rColSpan ) ) - aMIt->second->startNextRow(); - else - aMIt = maCellBlocks.insert( aMIt, CellBlockMap::value_type( rColSpan.mnLast, - CellBlockMap::mapped_type( new CellBlock( *this, rColSpan, rCellAddr.Row ) ) ) ); - } - // finalize and remove all remaining cell blocks - CellBlockMap::iterator aMEnd = maCellBlocks.end(); - for( CellBlockMap::iterator aMIt2 = aMIt; aMIt2 != aMEnd; ++aMIt2 ) - aMIt2->second->finalizeImport(); - maCellBlocks.erase( aMIt, aMEnd ); - - // remove cached colspan information (including current one aIt points to) - maColSpans.erase( maColSpans.begin(), ++aIt ); - } - maCellBlockIt = maCellBlocks.begin(); - mnCurrRow = rCellAddr.Row; - } - - // try to find a valid cell block (update maCellBlockIt) - if( ((maCellBlockIt != maCellBlocks.end()) && maCellBlockIt->second->contains( rCellAddr.Column )) || - (((maCellBlockIt = maCellBlocks.lower_bound( rCellAddr.Column )) != maCellBlocks.end()) && maCellBlockIt->second->contains( rCellAddr.Column )) ) - { - // maCellBlockIt points to valid cell block - return maCellBlockIt->second.get(); - } - - // no valid cell block found - return 0; -#endif // See start of method } void CellBlockBuffer::finalizeImport() diff --git a/unusedcode.easy b/unusedcode.easy index 79a729f..70c2c61 100755 --- a/unusedcode.easy +++ b/unusedcode.easy @@ -327,9 +327,6 @@ WPXPropertyList::Iter::last() WPXPropertyListVector::Iter::last() WPXString::Iter::last() WPXSubDocument::WPXSubDocument() -WinMtfOutput::DrawLine(Point const&, Point const&) -WinMtfOutput::GetTextLayoutMode() const -WinMtfOutput::SetFont(Font const&) Window::PostUserEvent(unsigned long&, unsigned long, void*) X11SalGraphics::SetMask(int&, int&, unsigned int&, unsigned int&, int&, int&, unsigned long) X509Certificate_NssImpl::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>) @@ -872,8 +869,9 @@ oox::dump::StringHelper::appendIndexedText(rtl::OUStringBuffer&, rtl::OUString c oox::dump::StringHelper::appendToken(rtl::OUStringBuffer&, long, unsigned short) oox::dump::StringHelper::prependToken(rtl::OUStringBuffer&, long, unsigned short) oox::dump::TextStreamObjectBase::construct(oox::dump::InputObjectBase const&, unsigned short) -oox::xls::BinAddress::write(oox::xls::BiffOutputStream&, bool, bool) const -oox::xls::BinRangeList::write(oox::xls::BiffOutputStream&, bool, bool) const +oox::ole::WordVbaProjectFilter::WordVbaProjectFilter(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&) +oox::xls::CellBlock::CellBlock(oox::xls::WorksheetHelper const&, oox::ValueRange const&, int) +oox::xls::prv::BiffOutputRecordBuffer::BiffOutputRecordBuffer(oox::BinaryOutputStream&, unsigned short) psp::PrinterGfx::DrawBitmap(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterBmp const&) psp::PrinterGfx::DrawMask(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterColor&) psp::PrinterGfx::GetGlyphBoundRect(unsigned short, Rectangle&) commit 79872b9181e60b02848acefd35d43f5d43fbea24 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 27 21:00:08 2012 +0100 exclude callcatcher output dirs from translation tools as well diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 211b647..5e9fcb9 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -342,6 +342,7 @@ bool includeProject(rtl::OUString const & project) { bool excludeDirectory(rtl::OUString const & directory) { // Cf. OUTPATH=* in configure.in: static AsciiString const excluded[] = { + { RTL_CONSTASCII_STRINGPARAM("callcatcher") }, { RTL_CONSTASCII_STRINGPARAM("unxaig") }, { RTL_CONSTASCII_STRINGPARAM("unxand") }, { RTL_CONSTASCII_STRINGPARAM("unxdfly") },
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits