summaryrefslogtreecommitdiff
path: root/sd/source/ui/table
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2010-06-03 11:55:10 +0200
committerIvo Hinkelmann <ihi@openoffice.org>2010-06-03 11:55:10 +0200
commitbdd37f7758920e43b556887b3cc2c70ea48e107d (patch)
tree44a9b08ea5665416c1f229675c6e6e00248c9e9b /sd/source/ui/table
parent9029bc641e0d0efdc7e7154e183864af7f91dfc8 (diff)
parentc2a240b1d4f0aea0db9490f0c5249806e5829ba7 (diff)
CWS-TOOLING: integrate CWS renaissance2
Diffstat (limited to 'sd/source/ui/table')
-rwxr-xr-x[-rw-r--r--]sd/source/ui/table/TableDesignPane.cxx4
-rwxr-xr-x[-rw-r--r--]sd/source/ui/table/tablefunction.cxx46
2 files changed, 40 insertions, 10 deletions
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx
index 678fdf6ccda7..2f35d70b0f0d 100644..100755
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -343,7 +343,9 @@ void TableDesignPane::onSelectionChanged()
}
Reference< XShapeDescriptor > xDesc( aSel, UNO_QUERY );
- if( xDesc.is() && xDesc->getShapeType().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.TableShape" ) ) )
+ if( xDesc.is() &&
+ ( xDesc->getShapeType().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.TableShape" ) ) ||
+ xDesc->getShapeType().equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.TableShape" ) ) ) )
{
xNewSelection = Reference< XPropertySet >::query( xDesc );
}
diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx
index 9d3de5904f43..b30e259e049a 100644..100755
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -70,6 +70,7 @@
#include "Window.hxx"
#include "drawview.hxx"
#include "sdresid.hxx"
+#include "undo/undoobjects.hxx"
using ::rtl::OUString;
using namespace ::sd;
@@ -147,21 +148,48 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
nRows = pDlg->getRows();
}
- Size aSize( 14100, 200 );
+ Rectangle aRect;
- Point aPos;
- Rectangle aWinRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
- aPos = aWinRect.Center();
- aPos = GetActiveWindow()->PixelToLogic(aPos);
- aPos.X() -= aSize.Width() / 2;
- aPos.Y() -= aSize.Height() / 2;
- Rectangle aRect (aPos, aSize);
+ SdrObject* pPickObj = mpView->GetEmptyPresentationObject( PRESOBJ_TABLE );
+ if( pPickObj )
+ {
+ aRect = pPickObj->GetLogicRect();
+ aRect.setHeight( 200 );
+ }
+ else
+ {
+ Size aSize( 14100, 200 );
+
+ Point aPos;
+ Rectangle aWinRect(aPos, GetActiveWindow()->GetOutputSizePixel() );
+ aPos = aWinRect.Center();
+ aPos = GetActiveWindow()->PixelToLogic(aPos);
+ aPos.X() -= aSize.Width() / 2;
+ aPos.Y() -= aSize.Height() / 2;
+ aRect = Rectangle(aPos, aSize);
+ }
::sdr::table::SdrTableObj* pObj = new ::sdr::table::SdrTableObj( GetDoc(), aRect, nColumns, nRows );
pObj->NbcSetStyleSheet( GetDoc()->GetDefaultStyleSheet(), sal_True );
apply_table_style( pObj, GetDoc(), sTableStyle );
SdrPageView* pPV = mpView->GetSdrPageView();
- mpView->InsertObjectAtView(pObj, *pPV, SDRINSERT_SETDEFLAYER);
+
+ // if we have a pick obj we need to make this new ole a pres obj replacing the current pick obj
+ if( pPickObj )
+ {
+ SdPage* pPage = static_cast< SdPage* >(pPickObj->GetPage());
+ if(pPage && pPage->IsPresObj(pPickObj))
+ {
+ pObj->SetUserCall( pPickObj->GetUserCall() );
+ pPage->InsertPresObj( pObj, PRESOBJ_TABLE );
+ }
+ }
+
+ if( pPickObj )
+ mpView->ReplaceObjectAtView(pPickObj, *pPV, pObj, TRUE );
+ else
+ mpView->InsertObjectAtView(pObj, *pPV, SDRINSERT_SETDEFLAYER);
+
Invalidate(SID_DRAWTBX_INSERT);
rReq.Ignore();
break;