Index: source/filter/inc/qpro.hxx =================================================================== RCS file: /cvs/sc/sc/source/filter/inc/Attic/qpro.hxx,v retrieving revision 1.1.4.4 diff -u -p -u -r1.1.4.4 qpro.hxx --- source/filter/inc/qpro.hxx 21 Sep 2005 13:23:41 -0000 1.1.4.4 +++ source/filter/inc/qpro.hxx 14 Oct 2005 15:08:39 -0000 @@ -55,8 +55,6 @@ // Stream wrapper class class ScQProReader : public ScBiffReader { - ScQProStyle aStyle; - public: bool recordsLeft(); bool IsEndOfFile(); @@ -68,8 +66,7 @@ class ScQProReader : public ScBiffReader ScQProReader( SfxMedium &rMedium, ScDocument* pDoc); ~ScQProReader(){ }; FltError import( ScDocument *pDoc ); - FltError readSheet( sal_uInt16 ntab, ScDocument* pDoc ); - ScQProStyle &getStyleElement() { return aStyle; } + FltError readSheet( sal_uInt16 ntab, ScDocument* pDoc, ScQProStyle *pStyle ); }; #endif Index: source/filter/inc/qprostyle.hxx =================================================================== RCS file: /cvs/sc/sc/source/filter/inc/Attic/qprostyle.hxx,v retrieving revision 1.1.2.3 diff -u -p -u -r1.1.2.3 qprostyle.hxx --- source/filter/inc/qprostyle.hxx 21 Sep 2005 13:23:41 -0000 1.1.2.3 +++ source/filter/inc/qprostyle.hxx 14 Oct 2005 15:08:39 -0000 @@ -52,15 +52,21 @@ class ScQProStyle { - sal_uInt8 maAlign[ 256 ]; - sal_uInt8 maFont[ 256 ]; - sal_uInt16 maFontRecord[ 256 ], maFontLimit, maAlignLimit; - String maFontType[ 256 ]; + sal_uInt8 maAlign[ 256 ]; + sal_uInt8 maFont[ 256 ]; + sal_uInt16 maFontRecord[ 256 ]; + sal_uInt16 maFontHeight[ 256 ]; + String maFontType[ 256 ]; + sal_uInt16 maFontLimit, maAlignLimit; public: - ScQProStyle() { } + ScQProStyle(); void SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow, sal_uInt8 nTab, sal_uInt16 nStyle ); - void setFontRecord( sal_uInt16 nIndex, sal_uInt16 nData ) { maFontRecord[ nIndex ] = nData; } + void setFontRecord( sal_uInt16 nIndex, sal_uInt16 nData, sal_uInt16 nPtSize ) + { + maFontRecord[ nIndex ] = nData; + maFontHeight[ nIndex ] = nPtSize; + } void setFontType( sal_uInt16 nIndex, String &aLabel ){ maFontType[ nIndex ] = aLabel; } void setAlign( sal_uInt16 nIndex, sal_uInt8 nData ) { maAlign[ nIndex ] = nData; } void setFont( sal_uInt16 nIndex, sal_uInt8 nData ) { maFont[ nIndex ] = nData; } Index: source/filter/qpro/qpro.cxx =================================================================== RCS file: /cvs/sc/sc/source/filter/qpro/Attic/qpro.cxx,v retrieving revision 1.1.4.5 diff -u -p -u -r1.1.4.5 qpro.cxx --- source/filter/qpro/qpro.cxx 21 Sep 2005 13:23:43 -0000 1.1.4.5 +++ source/filter/qpro/qpro.cxx 14 Oct 2005 15:08:45 -0000 @@ -51,7 +51,7 @@ #include "biff.hxx" #include -FltError ScQProReader::readSheet( sal_uInt16 nTab, ScDocument* pDoc ) +FltError ScQProReader::readSheet( sal_uInt16 nTab, ScDocument* pDoc, ScQProStyle *pStyle ) { sal_uInt8 nCol, nDummy; sal_uInt16 nRow; @@ -71,7 +71,7 @@ FltError ScQProReader::readSheet( sal_uI *mpStream >> nCol >> nDummy >> nRow >> nStyle >> nDummy; readString( aLabel, getLength() - 7 ); nStyle = nStyle >> 3; - getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); + pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); pDoc->PutCell( nCol, nRow, nTab, new ScStringCell( aLabel ), (BOOL) TRUE ); } break; @@ -83,7 +83,7 @@ FltError ScQProReader::readSheet( sal_uI case 0x000c: // Blank cell *mpStream >> nCol >> nDummy >> nRow >> nStyle; nStyle = nStyle >> 3; - getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); + pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); break; case 0x000d:{ // Integer cell @@ -91,7 +91,7 @@ FltError ScQProReader::readSheet( sal_uI *mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue; ScValueCell* pInteger = new ScValueCell( ( double ) nValue ); nStyle = nStyle >> 3; - getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); + pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); pDoc->PutCell(nCol ,nRow, nTab ,pInteger,(BOOL) TRUE); } break; @@ -101,7 +101,7 @@ FltError ScQProReader::readSheet( sal_uI *mpStream >> nCol >> nDummy >> nRow >> nStyle >> nValue; ScValueCell* pFloat = new ScValueCell( nValue ); nStyle = nStyle >> 3; - getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); + pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); pDoc->PutCell( nCol, nRow, nTab, pFloat, (BOOL) TRUE ); } break; @@ -117,7 +117,7 @@ FltError ScQProReader::readSheet( sal_uI ScFormulaCell *pFormula = new ScFormulaCell( pDoc, aAddr, pArray ); nStyle = nStyle >> 3; pFormula->AddRecalcMode( RECALCMODE_ONLOAD_ONCE ); - getStyleElement().SetFormat( pDoc, nCol, nRow, nTab, nStyle ); + pStyle->SetFormat( pDoc, nCol, nRow, nTab, nStyle ); pDoc->PutCell( nCol, nRow, nTab, pFormula, ( BOOL ) TRUE ); } break; @@ -135,8 +135,7 @@ FltError ScImportQuattroPro( SfxMedium & } ScQProReader::ScQProReader( SfxMedium &rMedium, ScDocument *pDoc ): - ScBiffReader( rMedium ), - aStyle() + ScBiffReader( rMedium ) { } @@ -146,6 +145,7 @@ FltError ScQProReader::import( ScDocumen sal_uInt16 nVersion; int i = 1 , j = 1; int nTab = 0; + ScQProStyle *aStyleElement = new ScQProStyle(); SetEof( FALSE ); if( !recordsLeft() ) @@ -166,7 +166,7 @@ FltError ScQProReader::import( ScDocumen aName.Append( sal_Unicode( 'A' + nTab ) ); pDoc->InsertTab( nTab, aName ); } - eRet = readSheet( nTab, pDoc ); + eRet = readSheet( nTab, pDoc, aStyleElement ); nTab++; break; @@ -178,8 +178,8 @@ FltError ScQProReader::import( ScDocumen sal_uInt8 nFormat, nAlign, nFont; sal_Int16 nColor; *mpStream >> nFormat >> nAlign >> nColor >> nFont; - getStyleElement().setAlign( i, nAlign ); - getStyleElement().setFont( i, nFont ); + aStyleElement->setAlign( i, nAlign ); + aStyleElement->setFont( i, nFont ); i++; } break; @@ -188,16 +188,14 @@ FltError ScQProReader::import( ScDocumen sal_uInt16 nPtSize, nFontAttr; String aLabel; *mpStream >> nPtSize >> nFontAttr; - getStyleElement().setFontRecord( j, nFontAttr ); + aStyleElement->setFontRecord( j, nFontAttr, nPtSize ); readString( aLabel, getLength() - 4 ); - getStyleElement().setFontType( j, aLabel ); + aStyleElement->setFontType( j, aLabel ); j++; } break; } } - getStyleElement().setFontLimit( j ); - getStyleElement().setAlignLimit( i ); pDoc->CalcAfterLoad(); return eRet; } Index: source/filter/qpro/qprostyle.cxx =================================================================== RCS file: /cvs/sc/sc/source/filter/qpro/Attic/qprostyle.cxx,v retrieving revision 1.1.2.3 diff -u -p -u -r1.1.2.3 qprostyle.cxx --- source/filter/qpro/qprostyle.cxx 21 Sep 2005 13:23:48 -0000 1.1.2.3 +++ source/filter/qpro/qprostyle.cxx 14 Oct 2005 15:08:46 -0000 @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -60,14 +61,22 @@ #include "document.hxx" #include "cell.hxx" +ScQProStyle::ScQProStyle() : + maFontLimit(0), maAlignLimit(0) +{ + rtl_fillMemory (maAlign, sizeof (maAlign), 0); + rtl_fillMemory (maFont, sizeof (maFont), 0); + rtl_fillMemory (maFontRecord, sizeof (maFontRecord), 0); + rtl_fillMemory (maFontHeight, sizeof (maFontRecord), 0); + for (int i = 0; i < sizeof (maFontType) / sizeof(maFontType[0]); i++) + maFontType[i] = String(); +} + void ScQProStyle::SetFormat( ScDocument *pDoc, sal_uInt8 nCol, sal_uInt16 nRow, sal_uInt8 nTab, sal_uInt16 nStyle ) { ScPatternAttr aPattern(pDoc->GetPool()); SfxItemSet& rItemSet = aPattern.GetItemSet(); - if( nStyle >= maAlignLimit ) - return; - sal_uInt8 nTmp = maAlign[ nStyle ]; sal_uInt8 nHor = ( nTmp & 0x07 ); sal_uInt8 nVer = ( nTmp & 0x18 ); @@ -137,8 +146,6 @@ void ScQProStyle::SetFormat( ScDocument } // Font Attributes - if( nStyle >= maFontLimit ) - return; sal_uInt16 nTmpFnt = maFontRecord[ maFont[ nStyle ] ]; BOOL bIsBold, bIsItalic, bIsUnderLine, bIsStrikeThrough; @@ -153,10 +160,12 @@ void ScQProStyle::SetFormat( ScDocument rItemSet.Put( SvxPostureItem( ITALIC_NORMAL, ATTR_FONT_POSTURE ) ); if( bIsUnderLine ) rItemSet.Put( SvxUnderlineItem( UNDERLINE_SINGLE, ATTR_FONT_UNDERLINE ) ); - + + if (maFontHeight[ maFont [ nStyle ] ]) + rItemSet.Put( SvxFontHeightItem( (ULONG) (20 * maFontHeight[ maFont[ nStyle ] ] ) ) ); + String fntName = maFontType[ maFont[ nStyle ] ]; rItemSet.Put( SvxFontItem( FAMILY_SYSTEM, fntName, EMPTY_STRING ) ); pDoc->ApplyPattern( nCol, nRow, nTab, aPattern ); } -