LibreOffice Module sw (master)  1
Classes | Typedefs | Functions
unotbl.hxx File Reference
#include <com/sun/star/container/XNamed.hpp>
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include <com/sun/star/util/XSortable.hpp>
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/text/XTextTableCursor.hpp>
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <com/sun/star/sheet/XCellRangeData.hpp>
#include <com/sun/star/table/XAutoFormattable.hpp>
#include <cppuhelper/implbase.hxx>
#include <comphelper/uno3.hxx>
#include <svl/listener.hxx>
#include "TextCursorHelper.hxx"
#include "unotext.hxx"
#include "frmfmt.hxx"
#include "unocrsr.hxx"
Include dependency graph for unotbl.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SwXCell
 
class  SwXTextTableRow
 
class  SwXTextTableCursor
 
struct  SwRangeDescriptor
 
class  SwXTextTable
 
class  SwXCellRange
 
class  SwXTableRows
 
class  SwXTableColumns
 

Typedefs

typedef cppu::WeakImplHelper< css::table::XCell, css::lang::XServiceInfo, css::beans::XPropertySet, css::container::XEnumerationAccess > SwXCellBaseClass
 
typedef cppu::WeakImplHelper< css::text::XTextTableCursor, css::lang::XServiceInfo, css::beans::XPropertySetSwXTextTableCursor_Base
 

Functions

int sw_CompareCellRanges (const OUString &rRange1StartCell, const OUString &rRange1EndCell, const OUString &rRange2StartCell, const OUString &rRange2EndCell, bool bCmpColsFirst)
 compare position of two cell ranges More...
 
void sw_NormalizeRange (OUString &rCell1, OUString &rCell2)
 cleanup order in a range More...
 
OUString sw_GetCellName (sal_Int32 nColumn, sal_Int32 nRow)
 get cell name at a specified coordinate More...
 
int sw_CompareCellsByColFirst (const OUString &rCellName1, const OUString &rCellName2)
 compare position of two cells (check columns first) More...
 
int sw_CompareCellsByRowFirst (const OUString &rCellName1, const OUString &rCellName2)
 compare position of two cells (check rows first) More...
 

Typedef Documentation

typedef cppu::WeakImplHelper< css::table::XCell, css::lang::XServiceInfo, css::beans::XPropertySet, css::container::XEnumerationAccess> SwXCellBaseClass

Definition at line 48 of file unotbl.hxx.

typedef cppu::WeakImplHelper< css::text::XTextTableCursor, css::lang::XServiceInfo, css::beans::XPropertySet> SwXTextTableCursor_Base

Definition at line 189 of file unotbl.hxx.

Function Documentation

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 473 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 446 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 423 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 544 of file unotbl.cxx.

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

Referenced by GetSubranges().