summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-05-28 11:55:02 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-06-02 08:50:55 +0200
commit996d5f81d049bde7148a3afc776f8cdaa6b0101e (patch)
treea73c8eee40f8c59154c170c95ad4be7d0169ad86 /svx
parentd8e82c657e59710aa683f08958d0d4d6a7d5054a (diff)
Pass also const CellRef& to save a lot of getCellByPosition() calls.
Change-Id: I86c89a05d263cada38ff54eaccf9ba39458db52e (cherry picked from commit 7b9b57b41936eea673eb678407ed817856ba0912)
Diffstat (limited to 'svx')
-rw-r--r--svx/source/table/tablelayouter.cxx10
-rw-r--r--svx/source/table/tablelayouter.hxx5
-rw-r--r--svx/source/table/viewcontactoftableobj.cxx2
3 files changed, 7 insertions, 10 deletions
diff --git a/svx/source/table/tablelayouter.cxx b/svx/source/table/tablelayouter.cxx
index 687fa2738a91..7f4651d31f10 100644
--- a/svx/source/table/tablelayouter.cxx
+++ b/svx/source/table/tablelayouter.cxx
@@ -72,14 +72,13 @@ TableLayouter::~TableLayouter()
-basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
+basegfx::B2ITuple TableLayouter::getCellSize( const CellRef& xCell, const CellPos& rPos ) const
{
sal_Int32 width = 0;
sal_Int32 height = 0;
try
{
- CellRef xCell( getCell( rPos ) );
if( xCell.is() && !xCell->isMerged() )
{
CellPos aPos( rPos );
@@ -117,14 +116,13 @@ basegfx::B2ITuple TableLayouter::getCellSize( const CellPos& rPos ) const
-bool TableLayouter::getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rArea ) const
+bool TableLayouter::getCellArea( const CellRef& xCell, const CellPos& rPos, basegfx::B2IRectangle& rArea ) const
{
try
{
- CellRef xCell( getCell( rPos ) );
if( xCell.is() && !xCell->isMerged() && isValid(rPos) )
{
- const basegfx::B2ITuple aCellSize( getCellSize( rPos ) );
+ const basegfx::B2ITuple aCellSize( getCellSize( xCell, rPos ) );
const bool bRTL = (mxTable->getSdrTableObj()->GetWritingMode() == WritingMode_RL_TB);
if( (rPos.mnCol < ((sal_Int32)maColumns.size()) && (rPos.mnRow < ((sal_Int32)maRows.size()) ) ) )
@@ -862,7 +860,7 @@ void TableLayouter::updateCells( Rectangle& rRectangle )
if( xCell.is() )
{
basegfx::B2IRectangle aCellArea;
- getCellArea( aPos, aCellArea );
+ getCellArea( xCell, aPos, aCellArea );
Rectangle aCellRect;
aCellRect.Left() = aCellArea.getMinX();
diff --git a/svx/source/table/tablelayouter.hxx b/svx/source/table/tablelayouter.hxx
index ce2b6348cf6d..f60fc3ef62cb 100644
--- a/svx/source/table/tablelayouter.hxx
+++ b/svx/source/table/tablelayouter.hxx
@@ -73,9 +73,7 @@ public:
void UpdateBorderLayout();
- basegfx::B2ITuple getCellSize( const CellPos& rPos ) const;
- bool getCellArea( const CellRef& xCell, basegfx::B2IRectangle& rArea ) const;
- bool getCellArea( const CellPos& rPos, basegfx::B2IRectangle& rArea ) const;
+ bool getCellArea( const CellRef& xCell, const CellPos& rPos, basegfx::B2IRectangle& rArea ) const;
::sal_Int32 getRowCount() const { return static_cast< ::sal_Int32 >( maRows.size() ); }
::sal_Int32 getColumnCount() const { return static_cast< ::sal_Int32 >( maColumns.size() ); }
@@ -103,6 +101,7 @@ public:
private:
CellRef getCell( const CellPos& rPos ) const;
+ basegfx::B2ITuple getCellSize( const CellRef& xCell, const CellPos& rPos ) const;
void LayoutTableWidth( ::Rectangle& rArea, bool bFit );
void LayoutTableHeight( ::Rectangle& rArea, bool bFit );
diff --git a/svx/source/table/viewcontactoftableobj.cxx b/svx/source/table/viewcontactoftableobj.cxx
index bc87338bb96f..08e282578f28 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -576,7 +576,7 @@ namespace sdr
if(xCurrentCell.is() && !xCurrentCell->isMerged())
{
- if(rTableLayouter.getCellArea(aCellPos, aCellArea))
+ if(rTableLayouter.getCellArea(xCurrentCell, aCellPos, aCellArea))
{
// create cell transformation matrix
basegfx::B2DHomMatrix aCellMatrix;