Kaydet (Commit) a2058142 authored tarafından Sven Jacobi's avatar Sven Jacobi

#98170# converting the autocolor before exporting

üst d371306d
......@@ -2,9 +2,9 @@
*
* $RCSfile: eppt.cxx,v $
*
* $Revision: 1.33 $
* $Revision: 1.34 $
*
* last change: $Author: sj $ $Date: 2002-02-18 17:15:23 $
* last change: $Author: sj $ $Date: 2002-03-28 11:48:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -1191,7 +1191,40 @@ sal_Bool PPTWriter::ImplCreateMainMaster()
mpPptEscherEx->AddAtom( 32, EPP_ColorSchemeAtom, 0, 6 );
*mpStrm << (sal_uInt32)0xffffff << (sal_uInt32)0x000000 << (sal_uInt32)0x808080 << (sal_uInt32)0x000000 << (sal_uInt32)0xff9933 << (sal_uInt32)0xccff99 << (sal_uInt32)0xcc00cc << (sal_uInt32)0xb2b2b2;
mpStyleSheet->Write( *mpStrm ,mpPptEscherEx );
for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
{
if ( nInstance == EPP_TEXTTYPE_notUsed )
continue;
// the auto color is dependent to the page background,so we have to set a page that is in the right context
if ( nInstance == EPP_TEXTTYPE_Notes )
ImplGetPageByIndex( 0, NOTICE );
else
ImplGetPageByIndex( 0, MASTER );
mpPptEscherEx->BeginAtom();
sal_Bool bFirst = TRUE;
sal_Bool bSimpleText = FALSE;
*mpStrm << (sal_uInt16)5; // paragraph count
for ( sal_uInt16 nLev = 0; nLev < 5; nLev++ )
{
if ( nInstance >= EPP_TEXTTYPE_CenterBody )
{
bFirst = FALSE;
bSimpleText = TRUE;
*mpStrm << nLev;
}
mpStyleSheet->mpParaSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
mpStyleSheet->mpCharSheet[ nInstance ]->Write( *mpStrm, mpPptEscherEx, nLev, bFirst, bSimpleText, mXPagePropSet );
bFirst = FALSE;
}
mpPptEscherEx->EndAtom( EPP_TxMasterStyleAtom, 0, nInstance );
}
EscherSolverContainer aSolverContainer;
......@@ -2068,7 +2101,7 @@ PPTExCharSheet::PPTExCharSheet( int nInstance )
rLev.mnFont = 0;
rLev.mnAsianOrComplexFont = 0xffff;
rLev.mnFontHeight = nFontHeight;
rLev.mnFontColor = 0xfe000000;
rLev.mnFontColor = 0;
rLev.mnEscapement = 0;
}
}
......@@ -2094,7 +2127,8 @@ void PPTExCharSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::co
rLev.mnFlags = aPortionObj.mnCharAttr;
}
void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText )
void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
{
const PPTExCharLevel& rLev = maCharLevel[ nLev ];
......@@ -2106,10 +2140,21 @@ void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sa
<< rLev.mnFlags
<< rLev.mnFont;
sal_uInt32 nFontColor = rLev.mnFontColor;
if ( nFontColor == COL_AUTO )
{
sal_Bool bIsDark = sal_False;
::com::sun::star::uno::Any aAny;
if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
aAny >>= bIsDark;
nFontColor = bIsDark ? 0xffffff : 0x000000;
}
nFontColor &= 0xffffff;
nFontColor |= 0xfe000000;
if ( bSimpleText )
{
rSt << rLev.mnFontHeight
<< rLev.mnFontColor;
<< nFontColor;
}
else
{
......@@ -2117,7 +2162,7 @@ void PPTExCharSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sa
<< (sal_uInt16)0xffff // unbekannt
<< (sal_uInt16)0xffff // unbekannt
<< rLev.mnFontHeight
<< rLev.mnFontColor
<< nFontColor
<< rLev.mnEscapement;
}
}
......@@ -2201,7 +2246,7 @@ PPTExParaSheet::PPTExParaSheet( int nInstance, sal_uInt16 nDefaultTab, PPTExBull
rLev.mnBulletChar = nBulletChar;
rLev.mnBulletFont = 0;
rLev.mnBulletHeight = 100;
rLev.mnBulletColor = 0xfe000000;
rLev.mnBulletColor = 0;
rLev.mnAdjust = 0;
rLev.mnLineFeed = 100;
rLev.mnLowerDist = 0;
......@@ -2301,7 +2346,8 @@ void PPTExParaSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::co
}
}
void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText )
void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet )
{
const PPTExParaLevel& rLev = maParaLevel[ nLev ];
......@@ -2331,13 +2377,23 @@ void PPTExParaSheet::Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sa
if ( nLev || bSimpleText )
nParaFlags &= 0x7fff;
sal_uInt32 nBulletColor = rLev.mnBulletColor;
if ( nBulletColor == COL_AUTO )
{
sal_Bool bIsDark = sal_False;
::com::sun::star::uno::Any aAny;
if ( PropValue::GetPropertyValue( aAny, rPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
aAny >>= bIsDark;
nBulletColor = bIsDark ? 0xffffff : 0x000000;
}
nBulletColor &= 0xffffff;
nBulletColor |= 0xfe000000;
rSt << nParaFlags
<< nBulletFlags
<< rLev.mnBulletChar
<< rLev.mnBulletFont
<< rLev.mnBulletHeight
<< rLev.mnBulletColor
<< nBulletColor
<< rLev.mnAdjust
<< rLev.mnLineFeed
<< rLev.mnUpperDist
......@@ -2382,7 +2438,6 @@ void PPTExStyleSheet::SetStyleSheet( const ::com::sun::star::uno::Reference< ::c
{
if ( nInstance == EPP_TEXTTYPE_notUsed )
return;
mpCharSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel );
mpParaSheet[ nInstance ]->SetStyleSheet( rXPropSet, rFontCollection, nLevel, mpCharSheet[ nInstance ]->maCharLevel[ nLevel ] );
}
......@@ -2434,36 +2489,6 @@ sal_Bool PPTExStyleSheet::IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLev
return TRUE;
}
void PPTExStyleSheet::Write( SvStream& rSt, PptEscherEx* pEx )
{
for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ )
{
if ( nInstance == EPP_TEXTTYPE_notUsed )
continue;
pEx->BeginAtom();
sal_Bool bFirst = TRUE;
sal_Bool bSimpleText = FALSE;
rSt << (sal_uInt16)5; // paragraph count
for ( sal_uInt16 nLev = 0; nLev < 5; nLev++ )
{
if ( nInstance >= EPP_TEXTTYPE_CenterBody )
{
bFirst = FALSE;
bSimpleText = TRUE;
rSt << nLev;
}
mpParaSheet[ nInstance ]->Write( rSt, pEx, nLev, bFirst, bSimpleText );
mpCharSheet[ nInstance ]->Write( rSt, pEx, nLev, bFirst, bSimpleText );
bFirst = FALSE;
}
pEx->EndAtom( EPP_TxMasterStyleAtom, 0, nInstance );
}
}
sal_uInt32 PPTExStyleSheet::SizeOfTxCFStyleAtom() const
{
return 24;
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: eppt.hxx,v $
*
* $Revision: 1.26 $
* $Revision: 1.27 $
*
* last change: $Author: sj $ $Date: 2001-08-31 14:54:30 $
* last change: $Author: sj $ $Date: 2002-03-28 11:48:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -520,7 +520,8 @@ struct PPTExCharSheet
void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
FontCollection& rFontCollection, int nLevel );
void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText );
void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
};
......@@ -560,15 +561,18 @@ struct PPTExParaSheet
void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
FontCollection& rFontCollection, int nLevel, const PPTExCharLevel& rCharLevel );
void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText );
void Write( SvStream& rSt, PptEscherEx* pEx, sal_uInt16 nLev, sal_Bool bFirst, sal_Bool bSimpleText,
const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & rPagePropSet );
};
class PPTExStyleSheet
{
PPTExCharSheet* mpCharSheet[ PPTEX_STYLESHEETENTRYS ];
PPTExParaSheet* mpParaSheet[ PPTEX_STYLESHEETENTRYS ];
public :
PPTExCharSheet* mpCharSheet[ PPTEX_STYLESHEETENTRYS ];
PPTExParaSheet* mpParaSheet[ PPTEX_STYLESHEETENTRYS ];
PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider& rBuProv );
~PPTExStyleSheet();
......@@ -578,7 +582,6 @@ class PPTExStyleSheet
void SetStyleSheet( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > &,
FontCollection& rFontCollection, int nInstance, int nLevel );
sal_Bool IsHardAttribute( sal_uInt32 nInstance, sal_uInt32 nLevel, PPTExTextAttr eAttr, sal_uInt32 nValue );
void Write( SvStream& rSt, PptEscherEx* pEx );
sal_uInt32 SizeOfTxCFStyleAtom() const;
void WriteTxCFStyleAtom( SvStream& rSt );
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: epptso.cxx,v $
*
* $Revision: 1.53 $
* $Revision: 1.54 $
*
* last change: $Author: sj $ $Date: 2002-03-18 17:21:58 $
* last change: $Author: sj $ $Date: 2002-03-28 11:48:38 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -1713,7 +1713,20 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
if ( nPropertyFlags & 0x40 )
rOut << (sal_Int16)nBuRealSize;
if ( nPropertyFlags & 0x20 )
rOut << pPara->nBulletColor;
{
sal_uInt32 nBulletColor = pPara->nBulletColor;
if ( nBulletColor == COL_AUTO )
{
sal_Bool bIsDark = sal_False;
::com::sun::star::uno::Any aAny;
if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
aAny >>= bIsDark;
nBulletColor = bIsDark ? 0xffffff : 0x000000;
}
nBulletColor &= 0xffffff;
nBulletColor |= 0xfe000000;
rOut << nBulletColor;
}
if ( nPropertyFlags & 0x00000800 )
rOut << (sal_uInt16)( pPara->mnTextAdjust );
if ( nPropertyFlags & 0x00001000 )
......@@ -1739,7 +1752,7 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj )
void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
sal_uInt32 nPropertyFlags, i = 0;
int nInstance = rTextObj.GetInstance();
int nInstance = rTextObj.GetInstance();
for ( ParagraphObj* pPara = rTextObj.First(); pPara; pPara = rTextObj.Next(), i++ )
{
......@@ -1747,10 +1760,20 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
{
nPropertyFlags = 0;
sal_uInt32 nCharAttr = pPortion->mnCharAttr;
sal_uInt32 nCharColor = pPortion->mnCharColor;
if (pPortion->mnCharColor & 0xffffff) // #97884# the fact that Ppt is displaying embossed text always using
if ( nCharColor == COL_AUTO ) // nCharColor depends to the background color
{
sal_Bool bIsDark = sal_False;
::com::sun::star::uno::Any aAny;
if ( PropValue::GetPropertyValue( aAny, mXPagePropSet, String( RTL_CONSTASCII_USTRINGPARAM( "IsBackgroundDark" ) ), sal_True ) )
aAny >>= bIsDark;
nCharColor = bIsDark ? 0xffffff : 0x000000;
}
nCharColor &= 0xffffff;
if ( nCharColor ) // #97884# the fact that Ppt is displaying embossed text always using
nCharAttr &=~ 0x200; // a black color, we can't export this attribute for all other colors,
nCharColor |= 0xfe000000;
if ( nInstance == 4 ) // special handling for normal textobjects:
nPropertyFlags |= nCharAttr & 0x217; // not all attributes ar inherited
else
......@@ -1789,7 +1812,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
( mpStyleSheet->IsHardAttribute( nInstance, pPara->bDepth, CharAttr_FontHeight, pPortion->mnCharHeight ) ) )
nPropertyFlags |= 0x00020000;
if ( ( pPortion->meCharColor == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
( mpStyleSheet->IsHardAttribute( nInstance, pPara->bDepth, CharAttr_FontColor, pPortion->mnCharColor ) ) )
( mpStyleSheet->IsHardAttribute( nInstance, pPara->bDepth, CharAttr_FontColor, nCharColor & 0xffffff ) ) )
nPropertyFlags |= 0x00040000;
if ( ( pPortion->meCharEscapement == ::com::sun::star::beans::PropertyState_DIRECT_VALUE ) ||
( mpStyleSheet->IsHardAttribute( nInstance, pPara->bDepth, CharAttr_Escapement, pPortion->mnCharEscapement ) ) )
......@@ -1809,7 +1832,7 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj )
if ( nPropertyFlags & 0x00020000 )
rOut << (sal_uInt16)( pPortion->mnCharHeight );
if ( nPropertyFlags & 0x00040000 )
rOut << (sal_uInt32)pPortion->mnCharColor;
rOut << (sal_uInt32)nCharColor;
if ( nPropertyFlags & 0x00080000 )
rOut << pPortion->mnCharEscapement;
}
......@@ -2157,9 +2180,9 @@ void PortionObj::ImplGetPortionValues( FontCollection& rFontCollection, sal_Bool
if ( ImplGetPropertyValue( String( RTL_CONSTASCII_USTRINGPARAM( "CharColor" ) ), bGetPropStateValue ) )
{
sal_uInt32 nSOColor = *( (sal_uInt32*)mAny.getValue() );
mnCharColor = nSOColor & 0xff00; // green
mnCharColor |= (sal_uInt8)( nSOColor ) << 16; // red
mnCharColor |= (sal_uInt8)( nSOColor >> 16 ) | 0xfe000000; // blue
mnCharColor = nSOColor & 0xff00ff00; // green and hibyte
mnCharColor |= (sal_uInt8)( nSOColor ) << 16; // red and blue is switched
mnCharColor |= (sal_uInt8)( nSOColor >> 16 );
}
meCharColor = ePropState;
......@@ -2534,9 +2557,9 @@ void ParagraphObj::ImplGetNumberingLevel( PPTExBulletProvider& rBuProv, sal_Int1
else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletColor" ) ) )
{
sal_uInt32 nSOColor = *( (sal_uInt32*)pValue );
nBulletColor = nSOColor & 0xff00; // GRUEN
nBulletColor |= (sal_uInt8)( nSOColor ) << 16; // ROT
nBulletColor |= (sal_uInt8)( nSOColor >> 16 ) | 0xfe000000; // BLAU
nBulletColor = nSOColor & 0xff00ff00; // green and hibyte
nBulletColor |= (sal_uInt8)( nSOColor ) << 16; // red
nBulletColor |= (sal_uInt8)( nSOColor >> 16 ) | 0xfe000000; // blue
}
else if ( aPropName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "BulletRelSize" ) ) )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment