LibreOffice Module sw (master)  1
Classes | Macros | Functions
unotbl.cxx File Reference
#include <tuple>
#include <utility>
#include <memory>
#include <vector>
#include <algorithm>
#include <o3tl/any.hxx>
#include <svx/svxids.hrc>
#include <editeng/memberids.h>
#include <float.h>
#include <swtypes.hxx>
#include <cmdid.h>
#include <unocoll.hxx>
#include <unomid.h>
#include <unomap.hxx>
#include <unotbl.hxx>
#include <section.hxx>
#include <unocrsr.hxx>
#include <hints.hxx>
#include <swtblfmt.hxx>
#include <doc.hxx>
#include <IDocumentUndoRedo.hxx>
#include <IDocumentContentOperations.hxx>
#include <IDocumentFieldsAccess.hxx>
#include <IDocumentState.hxx>
#include <IDocumentLayoutAccess.hxx>
#include <shellres.hxx>
#include <docary.hxx>
#include <ndole.hxx>
#include <ndtxt.hxx>
#include <frame.hxx>
#include <vcl/svapp.hxx>
#include <fmtfsize.hxx>
#include <tblafmt.hxx>
#include <tabcol.hxx>
#include <cellatr.hxx>
#include <fmtpdsc.hxx>
#include <pagedesc.hxx>
#include <viewsh.hxx>
#include <rootfrm.hxx>
#include <tabfrm.hxx>
#include <redline.hxx>
#include <unoport.hxx>
#include <unocrsrhelper.hxx>
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
#include <com/sun/star/text/WrapTextMode.hpp>
#include <com/sun/star/text/TextContentAnchorType.hpp>
#include <com/sun/star/text/TableColumnSeparator.hpp>
#include <com/sun/star/text/VertOrientation.hpp>
#include <com/sun/star/text/XTextSection.hpp>
#include <com/sun/star/table/TableBorder.hpp>
#include <com/sun/star/table/TableBorder2.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/table/TableBorderDistances.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart/XChartDataChangeEventListener.hpp>
#include <com/sun/star/chart/ChartDataChangeEvent.hpp>
#include <com/sun/star/table/CellContentType.hpp>
#include <unotextrange.hxx>
#include <unotextcursor.hxx>
#include <unoparagraph.hxx>
#include <svl/zforlist.hxx>
#include <editeng/formatbreakitem.hxx>
#include <editeng/shaditem.hxx>
#include <editeng/lrspitem.hxx>
#include <editeng/ulspitem.hxx>
#include <fmtornt.hxx>
#include <editeng/keepitem.hxx>
#include <fmtlsplt.hxx>
#include <swundo.hxx>
#include <osl/mutex.hxx>
#include <SwStyleNameMapper.hxx>
#include <frmatr.hxx>
#include <sortopt.hxx>
#include <rtl/math.hxx>
#include <sal/log.hxx>
#include <editeng/frmdiritem.hxx>
#include <comphelper/interfacecontainer2.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/string.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/sequence.hxx>
#include <comphelper/sequenceashashmap.hxx>
#include <swtable.hxx>
#include <docsh.hxx>
#include <fesh.hxx>
#include <itabenum.hxx>
Include dependency graph for unotbl.cxx:

Go to the source code of this file.

Classes

class  SwXTextTable::Impl
 
class  SwXCellRange::Impl
 
class  SwXTableRows::Impl
 
class  SwXTableColumns::Impl
 

Macros

#define UNO_TABLE_COLUMN_SUM   10000
 

Functions

static bool lcl_LineToSvxLine (const table::BorderLine &rLine, SvxBorderLine &rSvxLine)
 
static void lcl_SetSpecialProperty (SwFrameFormat *pFormat, const SfxItemPropertySimpleEntry *pEntry, const uno::Any &aValue)
 
static uno::Any lcl_GetSpecialProperty (SwFrameFormat *pFormat, const SfxItemPropertySimpleEntry *pEntry)
 
int sw_CompareCellsByRowFirst (const OUString &rCellName1, const OUString &rCellName2)
 compare position of two cells (check rows first) More...
 
int sw_CompareCellsByColFirst (const OUString &rCellName1, const OUString &rCellName2)
 compare position of two cells (check columns first) More...
 
int sw_CompareCellRanges (const OUString &rRange1StartCell, const OUString &rRange1EndCell, const OUString &rRange2StartCell, const OUString &rRange2EndCell, bool bCmpColsFirst)
 compare position of two cell ranges More...
 
OUString sw_GetCellName (sal_Int32 nColumn, sal_Int32 nRow)
 get cell name at a specified coordinate More...
 
static const SwTableBoxlcl_FindCornerTableBox (const SwTableLines &rTableLines, const bool i_bTopLeft)
 Find the top left or bottom right corner box in given table. More...
 
void sw_NormalizeRange (OUString &rCell1, OUString &rCell2)
 cleanup order in a range More...
 
static SwXCelllcl_CreateXCell (SwFrameFormat *pFormat, sal_Int32 nColumn, sal_Int32 nRow)
 
static void lcl_InspectLines (SwTableLines &rLines, std::vector< OUString > &rAllNames)
 
static bool lcl_FormatTable (SwFrameFormat const *pTableFormat)
 
static void lcl_CursorSelect (SwPaM &rCursor, bool bExpand)
 
static void lcl_GetTableSeparators (uno::Any &rRet, SwTable const *pTable, SwTableBox const *pBox, bool bRow)
 
static void lcl_SetTableSeparators (const uno::Any &rVal, SwTable *pTable, SwTableBox const *pBox, bool bRow, SwDoc *pDoc)
 
void sw_setString (SwXCell &rCell, const OUString &rText, bool bKeepNumberFormat=false)
 
void sw_setValue (SwXCell &rCell, double nVal)
 
static bool lcl_mayBeDefault (const sal_uInt16 nWhich, sal_uInt8 nMemberId, const SfxPoolItem *pPrevItem, const SfxPoolItem &rCurrItem, const bool bDirect)
 

Macro Definition Documentation

#define UNO_TABLE_COLUMN_SUM   10000

Function Documentation

static SwXCell* lcl_CreateXCell ( SwFrameFormat pFormat,
sal_Int32  nColumn,
sal_Int32  nRow 
)
static
static void lcl_CursorSelect ( SwPaM rCursor,
bool  bExpand 
)
static
static const SwTableBox* lcl_FindCornerTableBox ( const SwTableLines rTableLines,
const bool  i_bTopLeft 
)
static

Find the top left or bottom right corner box in given table.

Consider nested lines when finding the box.

Parameters
rTableLinesthe table
i_bTopLeftif true, find top left box, otherwise find bottom right box

Definition at line 503 of file unotbl.cxx.

References SwTableLines::back(), SwTableLines::empty(), and SwTableLines::front().

Referenced by SwXTextTable::getPropertyValue(), and SwXTextTable::setPropertyValue().

static bool lcl_FormatTable ( SwFrameFormat const *  pTableFormat)
static
static uno::Any lcl_GetSpecialProperty ( SwFrameFormat pFormat,
const SfxItemPropertySimpleEntry pEntry 
)
static
static void lcl_GetTableSeparators ( uno::Any rRet,
SwTable const *  pTable,
SwTableBox const *  pBox,
bool  bRow 
)
static
static void lcl_InspectLines ( SwTableLines rLines,
std::vector< OUString > &  rAllNames 
)
static

Definition at line 562 of file unotbl.cxx.

References SwTableLines::empty().

Referenced by SwXTextTable::getCellNames().

static bool lcl_LineToSvxLine ( const table::BorderLine &  rLine,
SvxBorderLine &  rSvxLine 
)
static

Definition at line 170 of file unotbl.cxx.

References convertMm100ToTwip().

Referenced by SwXTextTable::setPropertyValue().

static bool lcl_mayBeDefault ( const sal_uInt16  nWhich,
sal_uInt8  nMemberId,
const SfxPoolItem pPrevItem,
const SfxPoolItem rCurrItem,
const bool  bDirect 
)
static
static void lcl_SetSpecialProperty ( SwFrameFormat pFormat,
const SfxItemPropertySimpleEntry pEntry,
const uno::Any aValue 
)
static
static void lcl_SetTableSeparators ( const uno::Any rVal,
SwTable pTable,
SwTableBox const *  pBox,
bool  bRow,
SwDoc pDoc 
)
static
int sw_CompareCellRanges ( const OUString &  rRange1StartCell,
const OUString &  rRange1EndCell,
const OUString &  rRange2StartCell,
const OUString &  rRange2EndCell,
bool  bCmpColsFirst 
)

compare position of two cell ranges

Note
this function probably also make sense only for cell names of non-complex tables
Parameters
rRange1StartCelle.g. "A1" (non-empty string with valid cell name)
rRange1EndCelle.g. "A1" (non-empty string with valid cell name)
rRange2StartCelle.g. "A1" (non-empty string with valid cell name)
rRange2EndCelle.g. "A1" (non-empty string with valid cell name)
bCmpColsFirstif <true> position in columns will be compared first before rows
Returns
-1 if cell_range_1 < cell_range_2; 0 if both cell ranges are equal; +1 if cell_range_1 > cell_range_2

Definition at line 461 of file unotbl.cxx.

References sw_CompareCellsByColFirst(), and sw_CompareCellsByRowFirst().

Referenced by SortSubranges().

int sw_CompareCellsByColFirst ( const OUString &  rCellName1,
const OUString &  rCellName2 
)

compare position of two cells (check columns first)

Note
this function probably also make sense only for cell names of non-complex tables
Parameters
rCellName1e.g. "A1" (non-empty string with valid cell name)
rCellName2e.g. "A1" (non-empty string with valid cell name)
Returns
-1 if cell_1 < cell_2; 0 if both cells are equal; +1 if cell_1 > cell_2

Definition at line 434 of file unotbl.cxx.

References SwXTextTable::GetCellPosition(), nCol1, and nCol2.

Referenced by GetTableAndCellsFromRangeRep(), and sw_CompareCellRanges().

int sw_CompareCellsByRowFirst ( const OUString &  rCellName1,
const OUString &  rCellName2 
)

compare position of two cells (check rows first)

Note
this function probably also make sense only for cell names of non-complex tables
Parameters
rCellName1e.g. "A1" (non-empty string with valid cell name)
rCellName2e.g. "A1" (non-empty string with valid cell name)
Returns
-1 if cell_1 < cell_2; 0 if both cells are equal; +1 if cell_1 > cell_2

Definition at line 411 of file unotbl.cxx.

References SwXTextTable::GetCellPosition(), nCol1, and nCol2.

Referenced by sw_CompareCellRanges().

OUString sw_GetCellName ( sal_Int32  nColumn,
sal_Int32  nRow 
)
void sw_NormalizeRange ( OUString &  rCell1,
OUString &  rCell2 
)

cleanup order in a range

Sorts the input to a uniform format. I.e. for the four possible representation A1:C5, C5:A1, A5:C1, C1:A5 the result will be always A1:C5.

Parameters
[IN,OUT]rCell1 cell name (will be modified to upper-left corner), e.g. "A1" (non-empty string with valid cell name)
[IN,OUT]rCell2 cell name (will be modified to lower-right corner), e.g. "A1" (non-empty string with valid cell name)

Definition at line 532 of file unotbl.cxx.

References SwXTextTable::GetCellPosition(), nCol1, nCol2, and sw_GetCellName().

Referenced by GetSubranges().

void sw_setString ( SwXCell rCell,
const OUString &  rText,
bool  bKeepNumberFormat = false 
)
void sw_setValue ( SwXCell rCell,
double  nVal 
)