diff options
author | Mathias Bauer <mba@openoffice.org> | 2010-07-13 14:38:37 +0200 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2010-07-13 14:38:37 +0200 |
commit | de0d3255d183b96ecccb3b83fc25bc078ce846e9 (patch) | |
tree | ef16b81e9e847316e6a3037d0ac9b8b81795805b /sd/source/ui/table | |
parent | e2280d56bfd8f963b4caea5b200a83be8664d5a3 (diff) | |
parent | 4adb61dc6bb380ff31e145e6a77c92c0b26b42bd (diff) |
CWS changehid: resync to m84
Diffstat (limited to 'sd/source/ui/table')
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/table/TableDesignPane.cxx | 6 | ||||
-rwxr-xr-x[-rw-r--r--] | sd/source/ui/table/tablefunction.cxx | 46 |
2 files changed, 41 insertions, 11 deletions
diff --git a/sd/source/ui/table/TableDesignPane.cxx b/sd/source/ui/table/TableDesignPane.cxx index 678fdf6ccda7..cdba12e9887e 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 ); } @@ -389,7 +391,7 @@ void TableDesignPane::updateLayout() mxControls[nId]->SetPaintTransparent(TRUE); mxControls[nId]->SetBackground(); } - aValueSetSize = Size( aPaneSize.Width() - 2 * aOffset.X(), nStylesHeight - mxControls[FL_TABLE_STYLES]->GetSizePixel().Height() - mnOrgOffsetY[FL_TABLE_STYLES] ); + aValueSetSize = Size( pValueSet->GetSizePixel().Width(), nStylesHeight - mxControls[FL_TABLE_STYLES]->GetSizePixel().Height() - mnOrgOffsetY[FL_TABLE_STYLES] ); } else { 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; |