20#include <com/sun/star/chart/ChartDataRowSource.hpp>
21#include <com/sun/star/chart2/data/XDataProvider.hpp>
22#include <com/sun/star/chart2/data/XDataReceiver.hpp>
23#include <com/sun/star/chart2/XChartDocument.hpp>
24#include <com/sun/star/beans/PropertyState.hpp>
25#include <com/sun/star/embed/EmbedVerbs.hpp>
26#include <com/sun/star/embed/XEmbeddedObject.hpp>
84 nWidth = nRValid - nLValid;
94 OSL_ENSURE(nNum <=
m_aCols.
Count(),
"Index out of Area");
121 bool bCurrentOnly =
false;
129 int nDiff =
static_cast<int>(nNewWidth - nWidth);
156 OSL_ENSURE(
m_pSh,
"no Shell");
163 : m_pFormat(pShell->GetTableFormat()),
186 uno::Reference< chart2::data::XDataProvider >
const &rxDataProvider,
188 const OUString &rCellRange,
191 uno::Reference< frame::XModel > xChartModel;
213 uno::Reference < embed::XEmbeddedObject > xObj =
222 if (ppFlyFrameFormat)
223 *ppFlyFrameFormat = pTmp;
225 xChartModel.set( xObj->getComponent(), uno::UNO_QUERY );
226 if( xChartModel.is() )
229 uno::Reference<chart2::XChartDocument> xChartDoc(xChartModel, uno::UNO_QUERY);
231 xChartDoc->createDefaultChart();
233 xChartModel->lockControllers();
237 if (!
aName.isEmpty())
255 ErrCode nErr = pClient->
DoVerb(embed::EmbedVerbs::MS_OLEVERB_SHOW);
262 uno::Reference< chart2::data::XDataReceiver > xDataReceiver( xChartModel, uno::UNO_QUERY );
263 if (bFillWithData && xDataReceiver.is() && rxDataProvider.is())
265 xDataReceiver->attachDataProvider( rxDataProvider );
268 xDataReceiver->attachNumberFormatsSupplier( xNumberFormatsSupplier );
271 bool bHasCategories =
true;
272 bool bFirstCellAsLabel =
true;
273 chart::ChartDataRowSource eDataRowSource = chart::ChartDataRowSource_COLUMNS;
281 sal_Int32 nRowLen = aDesc.
nRight - aDesc.
nLeft + 1;
282 sal_Int32 nColLen = aDesc.
nBottom - aDesc.
nTop + 1;
284 bHasCategories =
false;
285 if (nRowLen == 1 && nColLen == 1)
286 bFirstCellAsLabel =
false;
287 else if (nRowLen > 1)
288 eDataRowSource = chart::ChartDataRowSource_ROWS;
289 else if (nColLen > 1)
290 eDataRowSource = chart::ChartDataRowSource_COLUMNS;
292 OSL_FAIL(
"unexpected state" );
296 uno::Sequence< beans::PropertyValue > aArgs{
297 beans::PropertyValue(
298 "CellRangeRepresentation", -1,
299 uno::Any( rCellRange ), beans::PropertyState_DIRECT_VALUE ),
300 beans::PropertyValue(
302 uno::Any( bHasCategories ), beans::PropertyState_DIRECT_VALUE ),
303 beans::PropertyValue(
304 "FirstCellAsLabel", -1,
305 uno::Any( bFirstCellAsLabel ), beans::PropertyState_DIRECT_VALUE ),
306 beans::PropertyValue(
308 uno::Any( eDataRowSource ), beans::PropertyState_DIRECT_VALUE )
310 xDataReceiver->setArguments( aArgs );
315 if( xChartModel.is() )
316 xChartModel->unlockControllers();
324 for(
size_t i = 0;
i <
nPos;
i++ )
341 OSL_ENSURE( nNum <
static_cast<int>(
GetColCount()) ,
"Index out of range");
static void AdaptDefaultsForChart(const css::uno::Reference< css::embed::XEmbeddedObject > &xEmbObj)
ErrCode DoVerb(sal_Int32 nVerb)
css::uno::Reference< css::frame::XModel3 > GetModel() const
SfxInPlaceClient * FindIPClient(const css::uno::Reference< css::embed::XEmbeddedObject > &xObj, vcl::Window *pObjParentWin) const
virtual VclPtr< VclAbstractDialog > CreateSwTableWidthDlg(weld::Window *pParent, SwTableFUNC &rFnc)=0
static SwAbstractDialogFactory * Create()
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
bool MoveTable(SwWhichTable, SwMoveFnCollection const &)
void SetChartName(const OUString &rName)
void StartAllAction()
For all views of this document.
bool HasOLEObj(std::u16string_view rName) const
Is there an OLEObject with this name (SwFormat)?
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
SwFrameFormat * GetTableFormat()
void UpdateCharts(const OUString &rName)
Update content of all charts for table with given name.
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void SetTabCols(const SwTabCols &rNew, bool bCurRowOnly)
void GetTabCols(SwTabCols &rToFill) const
Info about columns and margins.
void SetCheckForOLEInCaption(bool bFlag)
size_t GetCurTabColNum() const
void SetRight(tools::Long nNew)
tools::Long GetLeft() const
tools::Long GetRight() const
tools::Long GetRightMax() const
bool IsHidden(size_t nPos) const
SwTableFUNC(SwWrtShell *pShell)
sal_uInt16 GetColCount() const
void ColWidthDlg(weld::Window *pParent)
SwFrameFormat * m_pFormat
SwTwips GetMaxColWidth(sal_uInt16 nNum) const
void SetColWidth(sal_uInt16 nNum, SwTwips nWidth)
SAL_DLLPRIVATE int GetRightSeparator(int nNum) const
SwTwips GetColWidth(sal_uInt16 nNum) const
sal_uInt16 GetCurColNum() const
css::uno::Reference< css::frame::XModel > InsertChart(css::uno::Reference< css::chart2::data::XDataProvider > const &rxDataProvider, bool bFillWithData, const OUString &rCellRange, SwFlyFrameFormat **ppFlyFrameFormat=nullptr)
SwDocShell * GetDocShell()
Used by the UI to modify the document model.
bool Down(bool bSelect, sal_uInt16 nCount=1, bool bBasicCall=false)
virtual void CalcAndSetScale(svt::EmbeddedObjectRef &xObj, const SwRect *pFlyPrtRect=nullptr, const SwRect *pFlyFrameRect=nullptr, const bool bNoTextFramePrtAreaChanged=false) override
Client for OleObject has to be up-to-date regarding scaling.
bool InsertOleObject(const svt::EmbeddedObjectRef &xObj, SwFlyFrameFormat **pFlyFrameFormat=nullptr)
void SplitNode(bool bAutoFormat=false)
bool Up(bool bSelect, sal_uInt16 nCount=1, bool bBasicCall=false)
const SwView & GetView() const
css::uno::Reference< css::embed::XEmbeddedObject > CreateEmbeddedObject(const css::uno::Sequence< sal_Int8 > &, OUString &, OUString const *pBaseURL=nullptr)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
SwMoveFnCollection const & fnTableStart
bool GotoCurrTable(SwPaM &rCurrentCursor, SwMoveFnCollection const &fnPosTable, bool bInReadOnly)
bool FillRangeDescriptor(SwRangeDescriptor &rDesc, std::u16string_view rCellRangeName)
rCellRangeName needs to be of one of the following formats: