summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/shells/tabsh.cxx25
1 files changed, 24 insertions, 1 deletions
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index ead7b165eb21..586261803f11 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -833,7 +833,30 @@ void SwTableShell::Execute(SfxRequest &rReq)
bAfter = static_cast<const SfxBoolItem* >(pItem)->GetValue();
}
else if( !rReq.IsAPI() )
- ++nCount;
+ {
+ SwSelBoxes aBoxes;
+ ::GetTblSel( rSh, aBoxes );
+ if ( !aBoxes.empty() )
+ {
+ long maxX = 0;
+ long maxY = 0;
+ long minX = std::numeric_limits<long>::max();
+ long minY = std::numeric_limits<long>::max();
+ long nbBoxes = aBoxes.size();
+ for ( int i = 0; i < nbBoxes; i++ )
+ {
+ Point aCoord ( aBoxes[i]->GetCoordinates() );
+ if ( aCoord.X() < minX ) minX = aCoord.X();
+ if ( aCoord.X() > maxX ) maxX = aCoord.X();
+ if ( aCoord.Y() < minY ) minY = aCoord.Y();
+ if ( aCoord.Y() > maxY ) maxY = aCoord.Y();
+ }
+ if (bColumn)
+ nCount = maxX - minX + 1;
+ else
+ nCount = maxY - minY + 1;
+ }
+ }
if( nCount )
{