20#include <rtl/math.hxx>
21#include <rtl/character.hxx>
35#include <document.hxx>
70 sal_uInt16 nTmpCol(0), nTmpRow(0);
84 SetFormat(rContext, nCol, nRow, 0, nFormat, 0);
91 sal_uInt16 nTmpCol(0), nTmpRow(0);
100 fValue = ::rtl::math::round( fValue, 15 );
112 sal_uInt16 nTmpCol(0), nTmpRow(0);
117 n -= std::min<sal_uInt16>(
n, 5);
119 std::vector<char> aText(
n + 1);
137 sal_uInt16 nTmpCol(0), nTmpRow(0);
140 sal_uInt16 nFormulaSize(0);
146 std::unique_ptr<ScTokenArray> pResult;
147 sal_Int32 nBytesLeft = nFormulaSize;
152 aConv.
Reset( aAddress );
153 aConv.
Convert( pResult, nBytesLeft );
172 sal_uInt16 nTmpCol(0);
185 nBreite =
static_cast<sal_uInt16
>(
TWIPS_PER_CHAR * nWidthSpaces );
198 sal_uInt16 nColSt, nRowSt, nColEnd, nRowEnd;
200 char cBuffer[ 16+1 ];
212 std::unique_ptr<LotusRange> pRange;
214 if( nColSt == nColEnd && nRowSt == nRowEnd )
218 static_cast<SCCOL> (nColEnd),
static_cast<SCROW> (nRowEnd) ));
220 char cBuf[
sizeof(cBuffer)+1];
221 if( rtl::isAsciiDigit(
static_cast<unsigned char>(*cBuffer) ) )
224 strcpy( cBuf + 1, cBuffer );
227 strcpy( cBuf, cBuffer );
229 OUString aTmp( cBuf, strlen(cBuf), rContext.
eCharset );
239 sal_uInt16 nColSt, nRowSt, nColEnd, nRowEnd;
242 char cBuffer[ 16+1 ];
254 std::unique_ptr<LotusRange> pRange;
260 static_cast<SCCOL> (nColEnd),
static_cast<SCROW> (nRowEnd) ));
262 char cBuf[
sizeof(cBuffer)+1];
263 if( rtl::isAsciiDigit(
static_cast<unsigned char>(*cBuffer) ) )
266 strcpy( cBuf + 1, cBuffer );
269 strcpy( cBuf, cBuffer );
271 OUString aTmp( cBuf, strlen(cBuf), rContext.
eCharset );
295 for (sal_uInt16 nByte = 0; nByte < 32; ++nByte)
301 if( nCurrent & 0x01 )
308 nCurrent = nCurrent / 2;
344 sal_uInt16 nTmpCol(0), nTmpRow(0);
359 rContext.
bEOF =
true;
365 sal_uInt16 nTmpRow(0);
371 n -= std::min<sal_uInt16>(
n, 4);
373 std::unique_ptr<char[]> pText(
new char[
n + 1]);
382 sal_uInt16 nTmpRow(0);
402 sal_uInt16 nTmpRow(0);
410 std::unique_ptr<ScTokenArray> pResult;
411 sal_Int32 nBytesLeft = (
n > 12) ?
n - 12 : 0;
416 aConv.
Reset( aAddress );
417 aConv.
Convert( pResult, nBytesLeft );
433 sal_uInt16 nTmpRow(0);
452 sal_uInt16 nTmpRow(0);
459 n -= std::min<sal_uInt16>(
n, 4);
461 std::unique_ptr<char[]> pText(
new char[
n + 1]);
465 OUString aNoteText(pText.get(), strlen(pText.get()), rContext.
eCharset);
480 nAlignPattern = ( nAlignPattern & 0x07);
482 switch (nAlignPattern)
512 nAlignPattern = ( nAlignPattern & 0x07);
514 switch (nAlignPattern)
542 n -= std::min<sal_uInt16>(
n, 2);
544 if ( nCode == 0x0fd2 )
546 sal_uInt16 nPatternId;
550 bool bIsBold,bIsUnderLine,bIsItalics;
557 bIsBold = (temp & 0x01);
558 bIsItalics = (temp & 0x02);
559 bIsUnderLine = (temp & 0x04);
578 n -= std::min<sal_uInt16>(
n, 20);
593 sal_uInt16 nSheetNum(0);
596 const size_t nStrLen =
nLength - 4;
597 std::vector<char> sSheetName(nStrLen + 1);
598 sSheetName[rStream.
ReadBytes(sSheetName.data(), nStrLen)] = 0;
604 if (!sSheetName.empty())
606 OUString
aName(sSheetName.data(), strlen(sSheetName.data()), rContext.
eCharset);
614 sal_uInt16 nCol = 0, nColCount = 0, nRow = 0, nRowCount = 0, nTab = 0, nData, nTabCount = 0, nLevel = 0;
628 nTab = nTab + nTabCount;
629 nCol = 0; nColCount = 0;
630 nRow = 0; nRowCount = 0;
640 else if( nLevel == 2 )
642 nCol = nCol + nColCount;
647 else if( nLevel == 3 )
649 nRow = nRow + nRowCount;
663 std::map<sal_uInt16, ScPatternAttr>::iterator loc = rContext.
aLotusPatternPool.find( nData );
666 for(
int i = 0;
i < nTabCount;
i++)
679 while( nLevel && rStream.
good() );
bool ValidTab(SCTAB nTab)
SCTAB SanitizeTab(SCTAB nTab)
void Append(const ScDocument *pDoc, std::unique_ptr< LotusRange > pLR)
virtual void Convert(std::unique_ptr< ScTokenArray > &rpErg, sal_Int32 &nRest) override
void Reset(const ScAddress &rEingPos)
SC_DLLPUBLIC ScFormulaCell * SetFormulaCell(const ScAddress &rPos, ScFormulaCell *pCell)
Set formula cell, and transfer its ownership to the document.
SC_DLLPUBLIC void SetColHidden(SCCOL nStartCol, SCCOL nEndCol, SCTAB nTab, bool bHidden)
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC bool RenameTab(SCTAB nTab, const OUString &rName, bool bExternalDocument=false)
SC_DLLPUBLIC ScDocumentPool * GetPool()
SC_DLLPUBLIC void EnsureTable(SCTAB nTab)
SC_DLLPUBLIC void ApplyPatternAreaTab(SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow, SCTAB nTab, const ScPatternAttr &rAttr)
bool ValidAddress(const ScAddress &rAddress) const
SC_DLLPUBLIC void SetValue(SCCOL nCol, SCROW nRow, SCTAB nTab, const double &rVal)
SC_DLLPUBLIC void MakeTable(SCTAB nTab, bool _bNeedsNameCheck=true)
SCCOL SanitizeCol(SCCOL nCol) const
bool ValidCol(SCCOL nCol) const
SC_DLLPUBLIC svl::SharedStringPool & GetSharedStringPool()
SCTAB GetMaxTableNumber() const
SC_DLLPUBLIC void SetColWidth(SCCOL nCol, SCTAB nTab, sal_uInt16 nNewWidth)
bool ValidColRow(SCCOL nCol, SCROW nRow) const
static ScPostIt * CreateNoteFromString(ScDocument &rDoc, const ScAddress &rPos, const OUString &rNoteText, bool bShown, bool bAlwaysCreateCaption, sal_uInt32 nPostItId=0)
Creates a cell note based on the passed string and inserts it into the document.
SfxItemSet & GetItemSet()
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SvStream & ReadDouble(double &rDouble)
SvStream & ReadInt16(sal_Int16 &rInt16)
SvStream & ReadUInt32(sal_uInt32 &rUInt32)
std::size_t ReadBytes(void *pData, std::size_t nSize)
sal_uInt64 SeekRel(sal_Int64 nPos)
SvStream & ReadUInt16(sal_uInt16 &rUInt16)
SvStream & ReadUChar(unsigned char &rChar)
constexpr auto TWIPS_PER_CHAR
void OP_Number(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_Label123(LotusContext &rContext, SvStream &r, sal_uInt16 n)
void OP_BOF123(LotusContext &, SvStream &r, sal_uInt16)
void OP_CreatePattern123(LotusContext &rContext, SvStream &r, sal_uInt16 n)
void OP_Label(LotusContext &rContext, SvStream &r, sal_uInt16 n)
static sal_uInt16 nDefWidth
void OP_Margins(LotusContext &, SvStream &r, sal_uInt16 n)
void OP_ColumnWidth(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_Header(LotusContext &, SvStream &r, sal_uInt16 n)
void OP_HorAlign123(LotusContext &, sal_uInt8 nAlignPattern, SfxItemSet &rPatternItemSet)
void NI(LotusContext &, SvStream &r, sal_uInt16 n)
void OP_SymphNamedRange(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_BOF(LotusContext &, SvStream &r, sal_uInt16)
void OP_IEEENumber123(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_Note123(LotusContext &rContext, SvStream &r, sal_uInt16 n)
void OP_Formula123(LotusContext &rContext, SvStream &r, sal_uInt16 n)
void OP_Window1(LotusContext &rContext, SvStream &r, sal_uInt16 n)
void OP_SheetName123(LotusContext &rContext, SvStream &rStream, sal_uInt16 nLength)
void OP_VerAlign123(LotusContext &, sal_uInt8 nAlignPattern, SfxItemSet &rPatternItemSet)
void OP_EOF123(LotusContext &rContext, SvStream &, sal_uInt16)
void OP_Number123(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_Integer(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_Footer(LotusContext &, SvStream &r, sal_uInt16 n)
void OP_EOF(LotusContext &rContext, SvStream &, sal_uInt16)
void OP_Formula(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_HiddenCols(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_Blank(LotusContext &rContext, SvStream &r, sal_uInt16)
void OP_ApplyPatternArea123(LotusContext &rContext, SvStream &rStream)
void OP_NamedRange(LotusContext &rContext, SvStream &r, sal_uInt16)
#define LOTUS_FORMAT_INFO
#define ROW_FORMAT_MARKER
#define COL_FORMAT_MARKER
#define LOTUS_FORMAT_INDEX
constexpr TypedWhichId< SvxPostureItem > ATTR_FONT_POSTURE(103)
constexpr TypedWhichId< SvxWeightItem > ATTR_FONT_WEIGHT(102)
constexpr TypedWhichId< SvxHorJustifyItem > ATTR_HOR_JUSTIFY(129)
constexpr TypedWhichId< SvxVerJustifyItem > ATTR_VER_JUSTIFY(132)
constexpr TypedWhichId< SvxUnderlineItem > ATTR_FONT_UNDERLINE(104)
std::map< sal_uInt16, ScPatternAttr > aLotusPatternPool
LotusRangeList maRangeNames
rtl_TextEncoding eCharset