[Libreoffice-commits] core.git: sc/source

Jochen Nitschke j.nitschke+logerrit at ok.de
Wed Jan 11 15:39:46 UTC 2017


 sc/source/filter/inc/addressconverter.hxx |   12 ------------
 sc/source/filter/inc/worksheethelper.hxx  |    3 ---
 sc/source/filter/oox/addressconverter.cxx |    8 --------
 sc/source/filter/oox/commentsbuffer.cxx   |    6 +++---
 sc/source/filter/oox/worksheethelper.cxx  |   23 ++---------------------
 5 files changed, 5 insertions(+), 47 deletions(-)

New commits:
commit e316c4f2a40a4a562028f0a66c40321ffdf87378
Author: Jochen Nitschke <j.nitschke+logerrit at ok.de>
Date:   Wed Jan 11 14:08:37 2017 +0100

    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 at ok.de>
    Tested-by: Jochen Nitschke <j.nitschke+logerrit at ok.de>

diff --git a/sc/source/filter/inc/addressconverter.hxx b/sc/source/filter/inc/addressconverter.hxx
index 8dbd932..e8ed5c5 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 a571a89..bc5e9dd 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 a8452cc..a36a4e8 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 d9f22f4..d164f54 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 afed4ff..f739be3 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 );


More information about the Libreoffice-commits mailing list