23#include <com/sun/star/table/XTable.hpp>
24#include <com/sun/star/beans/XPropertySet.hpp>
40#include <editeng/editeng.hxx>
56 void WriteRow(
const Reference< XPropertySet >& xRowSet, sal_Int32 nRow,
const std::vector< sal_Int32 >& aColumnStart );
57 void WriteCell( sal_Int32 nCol, sal_Int32 nRow );
71constexpr OUStringLiteral
gsSize( u
"Size" );
76, mxTable( rObj.getTable() )
85 Reference< XTableColumns > xColumns(
mxTable->getColumns() );
86 const sal_Int32 nColCount = xColumns->getCount();
88 std::vector< sal_Int32 > aColumnStart;
89 aColumnStart.reserve( nColCount );
93 for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ )
try
95 Reference< XPropertySet > xSet( xColumns->getByIndex(nCol), UNO_QUERY_THROW );
97 xSet->getPropertyValue(
gsSize ) >>= nWidth;
99 aColumnStart.push_back(
nPos );
107 Reference< XTableRows > xRows(
mxTable->getRows() );
108 const sal_Int32 nRowCount = xRows->getCount();
110 for( sal_Int32 nRow = 0; nRow < nRowCount; nRow++ )
try
112 Reference< XPropertySet > xRowSet( xRows->getByIndex(nRow), UNO_QUERY_THROW );
113 WriteRow( xRowSet, nRow, aColumnStart );
125 sal_Int32 nRowHeight = 0;
126 xRowSet->getPropertyValue(
gsSize ) >>= nRowHeight;
131 const sal_Int32 nColCount =
mxTable->getColumnCount();
132 for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ )
134 CellRef xCell(
dynamic_cast< Cell*
>(
mxTable->getCellByPosition( nCol, nRow ).get() ) );
140 if ( (nCol & 0x0F) == 0x0F )
146 for( sal_Int32 nCol = 0; nCol < nColCount; nCol++ )
161 CellRef xCell(
dynamic_cast< Cell*
>(
mxTable->getCellByPosition( nCol, nRow ).get() ) );
163 if( !xCell.is() || xCell->isMerged() )
173 if( !pParaObj && xCell->GetOutlinerParaObject() )
174 pParaObj = *xCell->GetOutlinerParaObject();
187 bool bResetAttr =
false;
191 const SfxItemSet& rCellSet = xCell->GetItemSet();
OUString GetText(LineEnd eEnd=LINEEND_LF) const
void SetText(const OutlinerParaObject &)
const EditEngine & GetEditEngine() const
SdrOutliner & ImpGetDrawOutliner() const
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
SvStream & WriteOString(std::string_view rStr)
SvStream & WriteChar(char nChar)
FontItalic GetPosture() const
FontLineStyle GetLineStyle() const
FontWeight GetWeight() const
Reference< XTable > mxTable
void WriteCell(sal_Int32 nCol, sal_Int32 nRow)
void WriteRow(const Reference< XPropertySet > &xRowSet, sal_Int32 nRow, const std::vector< sal_Int32 > &aColumnStart)
SdrTableRtfExporter(SvStream &rStrmP, SdrTableObj &rObj)
#define SAL_NEWLINE_STRING
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr TypedWhichId< SvxUnderlineItem > EE_CHAR_UNDERLINE(EE_CHAR_START+5)
constexpr TypedWhichId< SvxWeightItem > EE_CHAR_WEIGHT(EE_CHAR_START+4)
constexpr TypedWhichId< SvxPostureItem > EE_CHAR_ITALIC(EE_CHAR_START+7)
SVT_DLLPUBLIC SvStream & Out_String(SvStream &, std::u16string_view, rtl_TextEncoding eDestEnc=RTL_TEXTENCODING_MS_1252)
constexpr auto toTwips(N number, Length from)
constexpr OUStringLiteral gsSize(u"Size")
void ExportAsRTF(SvStream &rStrm, SdrTableObj &rObj)
Hack for clipboard with calc and writer, export and import table content as rtf table.
#define OOO_STRING_SVTOOLS_RTF_CELL
#define OOO_STRING_SVTOOLS_RTF_QC
#define OOO_STRING_SVTOOLS_RTF_B
#define OOO_STRING_SVTOOLS_RTF_RTF
#define OOO_STRING_SVTOOLS_RTF_UL
#define OOO_STRING_SVTOOLS_RTF_QL
#define OOO_STRING_SVTOOLS_RTF_QJ
#define OOO_STRING_SVTOOLS_RTF_CELLX
#define OOO_STRING_SVTOOLS_RTF_TRRH
#define OOO_STRING_SVTOOLS_RTF_QR
#define OOO_STRING_SVTOOLS_RTF_ROW
#define OOO_STRING_SVTOOLS_RTF_ANSI
#define OOO_STRING_SVTOOLS_RTF_TRLEFT
#define OOO_STRING_SVTOOLS_RTF_INTBL
#define OOO_STRING_SVTOOLS_RTF_TROWD
#define OOO_STRING_SVTOOLS_RTF_TRGAPH
#define OOO_STRING_SVTOOLS_RTF_PLAIN
#define OOO_STRING_SVTOOLS_RTF_I
#define OOO_STRING_SVTOOLS_RTF_PARD
@ SDRTEXTHORZADJUST_BLOCK
@ SDRTEXTHORZADJUST_CENTER
@ SDRTEXTHORZADJUST_RIGHT