summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-11 14:08:37 +0100
committerJochen Nitschke <j.nitschke+logerrit@ok.de>2017-01-11 15:39:13 +0000
commite316c4f2a40a4a562028f0a66c40321ffdf87378 (patch)
tree1edbd1d6f714cb76b24b35a2ce527443869c9185
parentb365d56ed9862de518f91b34633faadce0cb0962 (diff)
tdf#48140 replace CellAddress in xlsx import (1)
Change-Id: I14bd0d9d55a03f4cd33aaf131e66f859569f5b18 Reviewed-on: https://gerrit.libreoffice.org/32968 Reviewed-by: Jochen Nitschke <j.nitschke+logerrit@ok.de> Tested-by: Jochen Nitschke <j.nitschke+logerrit@ok.de>
-rw-r--r--sc/source/filter/inc/addressconverter.hxx12
-rw-r--r--sc/source/filter/inc/worksheethelper.hxx3
-rw-r--r--sc/source/filter/oox/addressconverter.cxx8
-rw-r--r--sc/source/filter/oox/commentsbuffer.cxx6
-rw-r--r--sc/source/filter/oox/worksheethelper.cxx23
5 files changed, 5 insertions, 47 deletions
diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx
index 8dbd932555f3..e8ed5c5c1215 100644
--- a/sc/source/filter/inc/addressconverter.hxx
+++ b/sc/source/filter/inc/addressconverter.hxx
@@ -21,7 +21,6 @@
#define INCLUDED_SC_SOURCE_FILTER_INC_ADDRESSCONVERTER_HXX
#include <vector>
-#include <com/sun/star/table/CellAddress.hpp>
#include <com/sun/star/table/CellRangeAddress.hpp>
#include "workbookhelper.hxx"
@@ -247,17 +246,6 @@ public:
@return true = Passed address is valid (no index overflow).
*/
bool checkCellAddress(
- const css::table::CellAddress& rAddress,
- bool bTrackOverflow );
-
- /** Checks the passed cell address if it fits into the spreadsheet limits.
-
- @param rAddress The cell address to be checked.
- @param bTrackOverflow true = Update the internal overflow flags, if
- the address is outside of the supported sheet limits.
- @return true = Passed address is valid (no index overflow).
- */
- bool checkCellAddress(
const ScAddress& rAddress,
bool bTrackOverflow );
diff --git a/sc/source/filter/inc/worksheethelper.hxx b/sc/source/filter/inc/worksheethelper.hxx
index a571a894161f..bc5e9ddd7ea9 100644
--- a/sc/source/filter/inc/worksheethelper.hxx
+++ b/sc/source/filter/inc/worksheethelper.hxx
@@ -194,9 +194,6 @@ public:
/** Returns the XCell interface for the passed cell address. */
css::uno::Reference< css::table::XCell >
- getCell( const css::table::CellAddress& rAddress ) const;
-
- css::uno::Reference< css::table::XCell >
getCell( const ScAddress& rAddress ) const;
/** Returns the XCellRange interface for the passed cell range address. */
css::uno::Reference< css::table::XCellRange >
diff --git a/sc/source/filter/oox/addressconverter.cxx b/sc/source/filter/oox/addressconverter.cxx
index a8452cc7c798..a36a4e8b3c24 100644
--- a/sc/source/filter/oox/addressconverter.cxx
+++ b/sc/source/filter/oox/addressconverter.cxx
@@ -262,14 +262,6 @@ bool AddressConverter::checkTab( sal_Int16 nSheet, bool bTrackOverflow )
return bValid;
}
-bool AddressConverter::checkCellAddress( const CellAddress& rAddress, bool bTrackOverflow )
-{
- return
- checkTab( rAddress.Sheet, bTrackOverflow ) &&
- checkCol( rAddress.Column, bTrackOverflow ) &&
- checkRow( rAddress.Row, bTrackOverflow );
-}
-
bool AddressConverter::checkCellAddress( const ScAddress& rAddress, bool bTrackOverflow )
{
return
diff --git a/sc/source/filter/oox/commentsbuffer.cxx b/sc/source/filter/oox/commentsbuffer.cxx
index d9f22f485512..d164f5498a2a 100644
--- a/sc/source/filter/oox/commentsbuffer.cxx
+++ b/sc/source/filter/oox/commentsbuffer.cxx
@@ -133,16 +133,16 @@ void Comment::finalizeImport()
// BIFF12 stores cell range instead of cell address, use first cell of this range
OSL_ENSURE( maModel.maRange.aStart == maModel.maRange.aEnd,
"Comment::finalizeImport - comment anchor should be a single cell" );
- CellAddress aNotePos( maModel.maRange.aStart.Tab(), maModel.maRange.aStart.Col(), maModel.maRange.aStart.Row() );
- if( getAddressConverter().checkCellAddress( aNotePos, true ) && maModel.mxText.get() ) try
+ if( getAddressConverter().checkCellAddress( maModel.maRange.aStart, true ) && maModel.mxText.get() ) try
{
+ CellAddress aNotePos( maModel.maRange.aStart.Tab(), maModel.maRange.aStart.Col(), maModel.maRange.aStart.Row() );
Reference< XSheetAnnotationsSupplier > xAnnosSupp( getSheet(), UNO_QUERY_THROW );
Reference< XSheetAnnotations > xAnnos( xAnnosSupp->getAnnotations(), UNO_SET_THROW );
// non-empty string required by note implementation (real text will be added below)
xAnnos->insertNew( aNotePos, OUString( ' ' ) );
// receive created note from cell (insertNew does not return the note)
- Reference< XSheetAnnotationAnchor > xAnnoAnchor( getCell( aNotePos ), UNO_QUERY_THROW );
+ Reference< XSheetAnnotationAnchor > xAnnoAnchor( getCell( maModel.maRange.aStart ), UNO_QUERY_THROW );
Reference< XSheetAnnotation > xAnno( xAnnoAnchor->getAnnotation(), UNO_SET_THROW );
Reference< XSheetAnnotationShapeSupplier > xAnnoShapeSupp( xAnno, UNO_QUERY_THROW );
Reference< XShape > xAnnoShape( xAnnoShapeSupp->getAnnotationShape(), UNO_SET_THROW );
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index afed4ff47449..f739be348dcf 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -219,7 +219,6 @@ public:
inline const Reference< XSpreadsheet >& getSheet() const { return mxSheet; }
/** Returns the XCell interface for the passed cell address. */
- Reference< XCell > getCell( const CellAddress& rAddress ) const;
Reference< XCell > getCell( const ScAddress& rAddress ) const;
/** Returns the XCellRange interface for the passed cell range address. */
Reference< XCellRange > getCellRange( const ScRange& rRange ) const;
@@ -449,19 +448,6 @@ WorksheetGlobals::WorksheetGlobals( const WorkbookHelper& rHelper, const ISegmen
}
}
-Reference< XCell > WorksheetGlobals::getCell( const CellAddress& rAddress ) const
-{
- Reference< XCell > xCell;
- if( mxSheet.is() ) try
- {
- xCell = mxSheet->getCellByPosition( rAddress.Column, rAddress.Row );
- }
- catch( Exception& )
- {
- }
- return xCell;
-}
-
Reference< XCell > WorksheetGlobals::getCell( const ScAddress& rAddress ) const
{
Reference< XCell > xCell;
@@ -555,7 +541,7 @@ const awt::Size& WorksheetGlobals::getDrawPageSize() const
awt::Point WorksheetGlobals::getCellPosition( sal_Int32 nCol, sal_Int32 nRow ) const
{
awt::Point aPoint;
- PropertySet aCellProp( getCell( CellAddress( getSheetIndex(), nCol, nRow ) ) );
+ PropertySet aCellProp( getCell( ScAddress( nCol, nRow, getSheetIndex() ) ) );
aCellProp.getProperty( aPoint, PROP_Position );
return aPoint;
}
@@ -563,7 +549,7 @@ awt::Point WorksheetGlobals::getCellPosition( sal_Int32 nCol, sal_Int32 nRow ) c
awt::Size WorksheetGlobals::getCellSize( sal_Int32 nCol, sal_Int32 nRow ) const
{
awt::Size aSize;
- PropertySet aCellProp( getCell( CellAddress( getSheetIndex(), nCol, nRow ) ) );
+ PropertySet aCellProp( getCell( ScAddress( nCol, nRow, getSheetIndex() ) ) );
aCellProp.getProperty( aSize, PROP_Size );
return aSize;
}
@@ -1398,11 +1384,6 @@ const Reference< XSpreadsheet >& WorksheetHelper::getSheet() const
return mrSheetGlob.getSheet();
}
-Reference< XCell > WorksheetHelper::getCell( const CellAddress& rAddress ) const
-{
- return mrSheetGlob.getCell( rAddress );
-}
-
Reference< XCell > WorksheetHelper::getCell( const ScAddress& rAddress ) const
{
return mrSheetGlob.getCell( rAddress );