LibreOffice Module sw (master) 1
|
#include <tuple>
#include <utility>
#include <memory>
#include <vector>
#include <algorithm>
#include <limits>
#include <comphelper/interfacecontainer4.hxx>
#include <o3tl/any.hxx>
#include <o3tl/safeint.hxx>
#include <tools/UnitConversion.hxx>
#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 <IDocumentRedlineAccess.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/numformat.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 <SwStyleNameMapper.hxx>
#include <frmatr.hxx>
#include <sortopt.hxx>
#include <sal/log.hxx>
#include <editeng/frmdiritem.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 <frameformats.hxx>
#include <o3tl/string_view.hxx>
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 SfxItemPropertyMapEntry *pEntry, const uno::Any &aValue) |
static uno::Any | lcl_GetSpecialProperty (SwFrameFormat *pFormat, const SfxItemPropertyMapEntry *pEntry) |
int | sw_CompareCellsByRowFirst (std::u16string_view aCellName1, std::u16string_view aCellName2) |
compare position of two cells (check rows first) More... | |
int | sw_CompareCellsByColFirst (std::u16string_view aCellName1, std::u16string_view aCellName2) |
compare position of two cells (check columns first) More... | |
int | sw_CompareCellRanges (std::u16string_view aRange1StartCell, std::u16string_view aRange1EndCell, std::u16string_view aRange2StartCell, std::u16string_view aRange2EndCell, 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 SwTableBox * | lcl_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 rtl::Reference< SwXCell > | lcl_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) |
#define UNO_TABLE_COLUMN_SUM 10000 |
Definition at line 161 of file unotbl.cxx.
|
static |
Definition at line 545 of file unotbl.cxx.
References SwXCell::CreateXCell(), SwTable::FindTable(), SwTable::GetTableBox(), and sw_GetCellName().
Referenced by SwXTextTable::getCellByPosition(), SwXCellRange::getCellByPosition(), and SwXCellRange::GetCells().
|
static |
Definition at line 591 of file unotbl.cxx.
References SwPaM::DeleteMark(), SwPaM::HasMark(), and SwPaM::SetMark().
Referenced by SwXTextTableCursor::goDown(), SwXTextTableCursor::goLeft(), SwXTextTableCursor::goRight(), SwXTextTableCursor::gotoCellByName(), SwXTextTableCursor::gotoEnd(), SwXTextTableCursor::gotoStart(), and SwXTextTableCursor::goUp().
|
static |
Find the top left or bottom right corner box in given table.
Consider nested lines when finding the box.
rTableLines | the table |
i_bTopLeft | if true, find top left box, otherwise find bottom right box |
Definition at line 496 of file unotbl.cxx.
References SwTableLines::back(), SwTableLines::empty(), SwTableLines::front(), SwTableBox::GetSttNd(), SwTableLine::GetTabBoxes(), and SwTableBox::GetTabLines().
Referenced by SwXTextTable::getPropertyValue(), and SwXTextTable::setPropertyValue().
|
static |
Definition at line 570 of file unotbl.cxx.
References a, SwFrame::Calc(), SwIterator< TElementType, TSource, eMode >::First(), SwFrame::InvalidatePos(), SwFrameAreaDefinition::isFrameAreaDefinitionValid(), SwIterator< TElementType, TSource, eMode >::Next(), and SwTabFrame::SetONECalcLowers().
Referenced by SwXTextTable::attach(), SwXTextTableCursor::getPropertyValue(), SwXTextTable::getPropertyValue(), SwXTextTableCursor::setPropertyValue(), and SwXTextTable::setPropertyValue().
|
static |
Definition at line 258 of file unotbl.cxx.
References aTypes, CONVERT_TWIPS, SwXRedlinePortion::CreateRedlineProperties(), SwNode::EndOfSectionNode(), SwTable::FindTable(), FN_PARAM_LINK_DISPLAY_NAME, FN_TABLE_HEADLINE_COUNT, FN_TABLE_HEADLINE_REPEAT, FN_TABLE_IS_RELATIVE_WIDTH, FN_TABLE_RELATIVE_WIDTH, FN_TABLE_WIDTH, FN_UNO_ANCHOR_TYPES, FN_UNO_REDLINE_NODE_END, FN_UNO_REDLINE_NODE_START, FN_UNO_WRAP, SwFormat::GetAttrSet(), SwFormat::GetDoc(), SwFormat::GetFrameSize(), SwDoc::getIDocumentRedlineAccess(), SfxItemSet::GetItemIfSet(), SwFormat::GetName(), SwPageDesc::GetName(), SwStyleNameMapper::GetProgName(), IDocumentRedlineAccess::GetRedlineTable(), SwTable::GetRowsToRepeat(), SwTable::GetTableNode(), SwFormatFrameSize::GetWidthPercent(), MID_FRMSIZE_REL_WIDTH, MID_FRMSIZE_WIDTH, SfxItemPropertyMapEntry::nWID, PageDesc, SwFormatFrameSize::QueryValue(), RES_ANCHOR(), RES_PAGEDESC(), and rSet.
Referenced by SwXTextTable::getPropertyValue().
|
static |
Definition at line 602 of file unotbl.cxx.
References SwTabCols::Count(), SwTable::GetTabCols(), i, SwTabCols::IsHidden(), SwTabCols::SetLeft(), SwTabCols::SetLeftMin(), SwTabCols::SetRight(), SwTabCols::SetRightMax(), and UNO_TABLE_COLUMN_SUM.
Referenced by SwXTextTableRow::getPropertyValue(), and SwXTextTable::getPropertyValue().
|
static |
Definition at line 555 of file unotbl.cxx.
References SwTableLines::empty(), and lcl_InspectLines().
Referenced by SwXTextTable::getCellNames(), and lcl_InspectLines().
|
static |
Definition at line 164 of file unotbl.cxx.
References ColorTransparency, o3tl::mm100, and o3tl::toTwips().
Referenced by SwXTextTable::setPropertyValue().
|
static |
lang::IllegalArgumentException | |
uno::RuntimeException |
Definition at line 178 of file unotbl.cxx.
References SwStyleNameMapper::FillUIName(), SwTable::FindTable(), FN_TABLE_HEADLINE_COUNT, FN_TABLE_HEADLINE_REPEAT, FN_TABLE_IS_RELATIVE_WIDTH, FN_TABLE_RELATIVE_WIDTH, FN_TABLE_WIDTH, SwPageDesc::GetByName(), SwFormat::GetDoc(), SwFormat::GetFrameSize(), o3tl::mm100, SfxItemPropertyMapEntry::nWID, PageDesc, RES_PAGEDESC(), SAL_MAX_UINT16, SwDoc::SetAttr(), SwDoc::SetRowsToRepeat(), SvxSizeItem::SetWidth(), SwFormatFrameSize::SetWidthPercent(), and o3tl::toTwips().
Referenced by SwXTextTable::setPropertyValue().
|
static |
Definition at line 631 of file unotbl.cxx.
References SwTabCols::Count(), SwTable::GetTabCols(), i, SwTabCols::IsHidden(), SwTabCols::SetLeft(), SwTabCols::SetLeftMin(), SwTabCols::SetRight(), SwTabCols::SetRightMax(), SwDoc::SetTabCols(), and UNO_TABLE_COLUMN_SUM.
Referenced by SwXTextTableRow::setPropertyValue(), and SwXTextTable::setPropertyValue().
int sw_CompareCellRanges | ( | std::u16string_view | aRange1StartCell, |
std::u16string_view | aRange1EndCell, | ||
std::u16string_view | aRange2StartCell, | ||
std::u16string_view | aRange2EndCell, | ||
bool | bCmpColsFirst | ||
) |
compare position of two cell ranges
rRange1StartCell | e.g. "A1" (non-empty string with valid cell name) |
rRange1EndCell | e.g. "A1" (non-empty string with valid cell name) |
rRange2StartCell | e.g. "A1" (non-empty string with valid cell name) |
rRange2EndCell | e.g. "A1" (non-empty string with valid cell name) |
bCmpColsFirst | if <true> position in columns will be compared first before rows |
Definition at line 454 of file unotbl.cxx.
References sw_CompareCellsByColFirst(), and sw_CompareCellsByRowFirst().
Referenced by SortSubranges().
int sw_CompareCellsByColFirst | ( | std::u16string_view | aCellName1, |
std::u16string_view | aCellName2 | ||
) |
compare position of two cells (check columns first)
rCellName1 | e.g. "A1" (non-empty string with valid cell name) |
rCellName2 | e.g. "A1" (non-empty string with valid cell name) |
Definition at line 427 of file unotbl.cxx.
References SwXTextTable::GetCellPosition(), nCol1, and nCol2.
Referenced by GetTableAndCellsFromRangeRep(), and sw_CompareCellRanges().
int sw_CompareCellsByRowFirst | ( | std::u16string_view | aCellName1, |
std::u16string_view | aCellName2 | ||
) |
compare position of two cells (check rows first)
rCellName1 | e.g. "A1" (non-empty string with valid cell name) |
rCellName2 | e.g. "A1" (non-empty string with valid cell name) |
Definition at line 404 of file unotbl.cxx.
References SwXTextTable::GetCellPosition(), nCol1, and nCol2.
Referenced by sw_CompareCellRanges().
OUString sw_GetCellName | ( | sal_Int32 | nColumn, |
sal_Int32 | nRow | ||
) |
get cell name at a specified coordinate
nColumn | column index (0-based) |
nRow | row index (0-based) |
Definition at line 480 of file unotbl.cxx.
References sw_GetTableBoxColStr().
Referenced by SwChartDataProvider::convertRangeFromXML(), SwChartDataSequence::DeleteBox(), SwChartDataProvider::detectArguments(), SwChartDataSequence::ExtendTo(), SwChartDataSequence::generateLabel(), SwChartDataProvider::GetBrokenCellRangeForExport(), SwXTextTable::getCellRangeByPosition(), SwXCellRange::getCellRangeByPosition(), SwChartDataProvider::Impl_createDataSource(), SwXTableRows::insertByIndex(), SwXTableColumns::insertByIndex(), lcl_CreateXCell(), SwXTableRows::removeByIndex(), SwXTableColumns::removeByIndex(), and sw_NormalizeRange().
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.
[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 525 of file unotbl.cxx.
References SwXTextTable::GetCellPosition(), min(), nCol1, nCol2, and sw_GetCellName().
Referenced by GetSubranges().
void sw_setString | ( | SwXCell & | rCell, |
const OUString & | rText, | ||
bool | bKeepNumberFormat = false |
||
) |
Definition at line 668 of file unotbl.cxx.
Referenced by SwXCellRange::setDataArray().
void sw_setValue | ( | SwXCell & | rCell, |
double | nVal | ||
) |
! do we need to set a new number format? Yes, if
Definition at line 686 of file unotbl.cxx.
Referenced by SwXCellRange::setDataArray().