diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/Library_scfilt.mk | 1 | ||||
-rw-r--r-- | sc/source/filter/inc/biffoutputstream.hxx | 83 | ||||
-rw-r--r-- | sc/source/filter/oox/addressconverter.cxx | 1 | ||||
-rw-r--r-- | sc/source/filter/oox/biffhelper.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/biffoutputstream.cxx | 81 |
5 files changed, 1 insertions, 167 deletions
diff --git a/sc/Library_scfilt.mk b/sc/Library_scfilt.mk index 8f5370f6e944..83ee7ad04702 100644 --- a/sc/Library_scfilt.mk +++ b/sc/Library_scfilt.mk @@ -167,7 +167,6 @@ $(eval $(call gb_Library_add_exception_objects,scfilt,\ sc/source/filter/oox/biffdetector \ sc/source/filter/oox/biffhelper \ sc/source/filter/oox/biffinputstream \ - sc/source/filter/oox/biffoutputstream \ sc/source/filter/oox/chartsheetfragment \ sc/source/filter/oox/commentsbuffer \ sc/source/filter/oox/commentsfragment \ diff --git a/sc/source/filter/inc/biffoutputstream.hxx b/sc/source/filter/inc/biffoutputstream.hxx deleted file mode 100644 index 20e92ea56c5e..000000000000 --- a/sc/source/filter/inc/biffoutputstream.hxx +++ /dev/null @@ -1,83 +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_BIFFOUTPUTSTREAM_HXX -#define OOX_XLS_BIFFOUTPUTSTREAM_HXX - -#include <vector> -#include "oox/helper/binaryoutputstream.hxx" -#include "biffhelper.hxx" - -namespace oox { class BinaryOutputStream; } - -namespace oox { -namespace xls { - -// ============================================================================ - -namespace prv { - -/** Buffers the contents of a raw record. */ -class BiffOutputRecordBuffer -{ -public: - explicit BiffOutputRecordBuffer( - BinaryOutputStream& rOutStrm, - sal_uInt16 nMaxRecSize ); - /** Returns the wrapped binary base stream. */ - inline const BinaryOutputStream& getBaseStream() const { return mrOutStrm; } - - /** Starts a new record. */ - void startRecord( sal_uInt16 nRecId ); - /** Finishes the current record. Must be called for every started record. */ - void endRecord(); - - /** Returns the number of remaining bytes in the current record body. */ - inline sal_uInt16 getRecLeft() const { return static_cast< sal_uInt16 >( mnMaxRecSize - maData.size() ); } - - /** Writes nBytes bytes from the existing buffer pData. Must NOT overwrite the destination buffer. */ - void write( const void* pData, sal_uInt16 nBytes ); - -private: - typedef ::std::vector< sal_uInt8 > DataBuffer; - - BinaryOutputStream& mrOutStrm; /// Core output stream. - DataBuffer maData; /// Record data buffer. - sal_uInt16 mnMaxRecSize; /// Maximum size of record contents. - sal_uInt16 mnRecId; /// Current record identifier. - bool mbInRec; /// True = currently writing inside of a record. -}; - -} // namespace prv - -} // 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 f827600d8045..e6063962fbc9 100644 --- a/sc/source/filter/oox/addressconverter.cxx +++ b/sc/source/filter/oox/addressconverter.cxx @@ -36,7 +36,6 @@ #include <rtl/ustrbuf.hxx> #include "oox/core/filterbase.hxx" #include "biffinputstream.hxx" -#include "biffoutputstream.hxx" namespace oox { namespace xls { diff --git a/sc/source/filter/oox/biffhelper.cxx b/sc/source/filter/oox/biffhelper.cxx index da426b606ad8..ec6153938b88 100644 --- a/sc/source/filter/oox/biffhelper.cxx +++ b/sc/source/filter/oox/biffhelper.cxx @@ -31,8 +31,8 @@ #include <rtl/math.hxx> #include <rtl/tencinfo.h> #include "biffinputstream.hxx" -#include "biffoutputstream.hxx" #include "worksheethelper.hxx" +#include "oox/helper/binaryoutputstream.hxx" namespace oox { namespace xls { diff --git a/sc/source/filter/oox/biffoutputstream.cxx b/sc/source/filter/oox/biffoutputstream.cxx deleted file mode 100644 index dc7f39f89bb7..000000000000 --- a/sc/source/filter/oox/biffoutputstream.cxx +++ /dev/null @@ -1,81 +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. - * - ************************************************************************/ - -#include "biffoutputstream.hxx" - -namespace oox { -namespace xls { - -// ============================================================================ - -namespace prv { - -BiffOutputRecordBuffer::BiffOutputRecordBuffer( BinaryOutputStream& rOutStrm, sal_uInt16 nMaxRecSize ) : - mrOutStrm( rOutStrm ), - mnMaxRecSize( nMaxRecSize ), - mnRecId( BIFF_ID_UNKNOWN ), - mbInRec( false ) -{ - OSL_ENSURE( mrOutStrm.isSeekable(), "BiffOutputRecordBuffer::BiffOutputRecordBuffer - stream must be seekable" ); - maData.reserve( SAL_MAX_UINT16 ); -} - -void BiffOutputRecordBuffer::startRecord( sal_uInt16 nRecId ) -{ - OSL_ENSURE( !mbInRec, "BiffOutputRecordBuffer::startRecord - another record still open" ); - mnRecId = nRecId; - maData.clear(); - mbInRec = true; -} - -void BiffOutputRecordBuffer::endRecord() -{ - OSL_ENSURE( mbInRec, "BiffOutputRecordBuffer::endRecord - no record open" ); - sal_uInt16 nRecSize = getLimitedValue< sal_uInt16, size_t >( maData.size(), 0, SAL_MAX_UINT16 ); - mrOutStrm.seekToEnd(); - mrOutStrm << mnRecId << nRecSize; - if( nRecSize > 0 ) - mrOutStrm.writeMemory( &maData.front(), nRecSize ); - mbInRec = false; -} - -void BiffOutputRecordBuffer::write( const void* pData, 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 ); - memcpy( &*(maData.end() - nBytes), pData, nBytes ); -} - -} // namespace prv - -} // namespace xls -} // namespace oox - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |