Kaydet (Commit) 31b05fe9 authored tarafından Matúš Kukan's avatar Matúš Kukan

unusedcode: drop CellBlock and one small method

Change-Id: I7cad80ea59b4527193a35ea1b7cfdd56e07a0efe
üst a5ae5d95
......@@ -56,11 +56,6 @@ namespace comphelper
virtual void _disposing(const ::com::sun::star::lang::EventObject& _rSource) throw( ::com::sun::star::uno::RuntimeException);
protected:
/** If the derivee also owns the mutex which we know as reference, then call this within your
derivee's dtor.
*/
void disposeAdapter();
// pseudo-private. Making it private now could break compatibility
void setAdapter( OSelectionChangeMultiplexer* _pAdapter );
};
......
......@@ -46,16 +46,6 @@ void OSelectionChangeListener::_disposing(const EventObject&) throw( RuntimeExce
// nothing to do here
}
//------------------------------------------------------------------
void OSelectionChangeListener::disposeAdapter()
{
if ( m_pAdapter )
m_pAdapter->dispose();
// will automatically set a new adapter
OSL_ENSURE( !m_pAdapter, "OSelectionChangeListener::disposeAdapter: what did dispose do?" );
}
//------------------------------------------------------------------
void OSelectionChangeListener::setAdapter(OSelectionChangeMultiplexer* pAdapter)
{
......
......@@ -90,48 +90,6 @@ struct DataTableModel
// ============================================================================
/** Stores position and contents of a range of cells for optimized import. */
class CellBlock : public WorksheetHelper
{
public:
explicit CellBlock( const WorksheetHelper& rHelper, const ValueRange& rColSpan, sal_Int32 nRow );
/** Writes all buffered cells into the Calc sheet. */
void finalizeImport();
private:
/** Fills unused cells before passed index with empty strings. */
void fillUnusedCells( sal_Int32 nIndex );
private:
/** Stores position and string data of a rich-string cell. */
struct RichStringCell
{
::com::sun::star::table::CellAddress
maCellAddr; /// The address of the rich-string cell.
RichStringRef mxString; /// The string with rich formatting.
const Font* mpFirstPortionFont; /// Font information from cell for first text portion.
explicit RichStringCell(
const ::com::sun::star::table::CellAddress& rCellAddr,
const RichStringRef& rxString,
const Font* pFirstPortionFont );
};
typedef ::std::list< RichStringCell > RichStringCellList;
::com::sun::star::table::CellRangeAddress
maRange; /// Cell range covered by this cell block.
RichStringCellList maRichStrings; /// Cached rich-string cells.
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >
maCellArray; /// The array of cells of this cell block.
::com::sun::star::uno::Any*
mpCurrCellRow; /// Pointer to first cell of current row (last row in maCellArray).
const sal_Int32 mnRowLength; /// Number of cells covered by row of this cell block.
sal_Int32 mnFirstFreeIndex; /// Relative index of first unused cell in current row.
};
// ============================================================================
/** Manages all cell blocks currently in use. */
class CellBlockBuffer : public WorksheetHelper
{
......@@ -146,11 +104,8 @@ public:
private:
typedef ::std::map< sal_Int32, ValueRangeVector > ColSpanVectorMap;
typedef RefMap< sal_Int32, CellBlock > CellBlockMap;
ColSpanVectorMap maColSpans; /// Buffereed column spans, mapped by row index.
CellBlockMap maCellBlocks; /// All open cell blocks, mapped by last (!) column of the block span.
CellBlockMap::iterator maCellBlockIt; /// Pointer to cell block currently in use.
sal_Int32 mnCurrRow; /// Current row index used for buffered cell import.
};
......
......@@ -120,67 +120,10 @@ DataTableModel::DataTableModel() :
// ============================================================================
namespace {
const sal_Int32 CELLBLOCK_MAXROWS = 16; /// Number of rows in a cell block.
} // namespace
CellBlock::CellBlock( const WorksheetHelper& rHelper, const ValueRange& rColSpan, sal_Int32 nRow ) :
WorksheetHelper( rHelper ),
maRange( rHelper.getSheetIndex(), rColSpan.mnFirst, nRow, rColSpan.mnLast, nRow ),
mnRowLength( rColSpan.mnLast - rColSpan.mnFirst + 1 ),
mnFirstFreeIndex( 0 )
{
maCellArray.realloc( 1 );
maCellArray[ 0 ].realloc( mnRowLength );
mpCurrCellRow = maCellArray[ 0 ].getArray();
}
void CellBlock::finalizeImport()
{
// fill last cells in last row with empty strings (placeholder for empty cells)
fillUnusedCells( mnRowLength );
// insert all buffered cells into the Calc sheet
try
{
Reference< XCellRangeData > xRangeData( getCellRange( maRange ), UNO_QUERY_THROW );
xRangeData->setDataArray( maCellArray );
}
catch( Exception& )
{
}
// insert uncacheable cells separately
for( RichStringCellList::const_iterator aIt = maRichStrings.begin(), aEnd = maRichStrings.end(); aIt != aEnd; ++aIt )
putRichString( aIt->maCellAddr, *aIt->mxString, aIt->mpFirstPortionFont );
}
// private --------------------------------------------------------------------
CellBlock::RichStringCell::RichStringCell( const CellAddress& rCellAddr, const RichStringRef& rxString, const Font* pFirstPortionFont ) :
maCellAddr( rCellAddr ),
mxString( rxString ),
mpFirstPortionFont( pFirstPortionFont )
{
}
void CellBlock::fillUnusedCells( sal_Int32 nIndex )
{
if( mnFirstFreeIndex < nIndex )
{
Any* pCellEnd = mpCurrCellRow + nIndex;
for( Any* pCell = mpCurrCellRow + mnFirstFreeIndex; pCell < pCellEnd; ++pCell )
*pCell <<= OUString();
}
}
// ============================================================================
CellBlockBuffer::CellBlockBuffer( const WorksheetHelper& rHelper ) :
WorksheetHelper( rHelper ),
mnCurrRow( -1 )
{
maCellBlockIt = maCellBlocks.end();
}
void CellBlockBuffer::setColSpans( sal_Int32 nRow, const ValueRangeSet& rColSpans )
......@@ -193,7 +136,6 @@ void CellBlockBuffer::setColSpans( sal_Int32 nRow, const ValueRangeSet& rColSpan
void CellBlockBuffer::finalizeImport()
{
maCellBlocks.forEachMem( &CellBlock::finalizeImport );
}
// ============================================================================
......
......@@ -299,7 +299,6 @@ cairocanvas::SpriteDeviceHelper::getSurface()
cairocanvas::TextLayout::draw(_cairo*)
canvas::createSurfaceProxyManager(boost::shared_ptr<canvas::IRenderModule> const&)
cmis::Content::exchangeIdentity(com::sun::star::uno::Reference<com::sun::star::ucb::XContentIdentifier> const&)
comphelper::OSelectionChangeListener::disposeAdapter()
comphelper::detail::ConfigurationWrapper::getGroupReadWrite(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&) const
comphelper::detail::ConfigurationWrapper::getLocalizedPropertyValue(rtl::OUString const&) const
comphelper::detail::ConfigurationWrapper::setLocalizedPropertyValue(boost::shared_ptr<comphelper::ConfigurationChanges> const&, rtl::OUString const&, com::sun::star::uno::Any const&) const
......@@ -321,8 +320,6 @@ nullcanvas::SpriteCanvasHelper::opaqueUpdate(basegfx::B2DConnectedRanges<canvas:
nullcanvas::SpriteCanvasHelper::scrollUpdate(basegfx::B2DRange const&, basegfx::B2DRange const&, basegfx::B2DConnectedRanges<canvas::SpriteRedrawManager::SpriteInfo>::ConnectedComponents const&)
oox::drawingml::TextParagraphProperties::dump() const
oox::xls::BiffDrawingObjectBase::BiffDrawingObjectBase(oox::xls::WorksheetHelper const&)
oox::xls::CellBlock::CellBlock(oox::xls::WorksheetHelper const&, oox::ValueRange const&, int)
oox::xls::CellBlock::RichStringCell::RichStringCell(com::sun::star::table::CellAddress const&, boost::shared_ptr<oox::xls::RichString> const&, oox::xls::Font const*)
sd::LeftDrawPaneShell::RegisterInterface(SfxModule*)
sd::LeftImpressPaneShell::RegisterInterface(SfxModule*)
sd::ToolPanelPaneShell::RegisterInterface(SfxModule*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment