Fix more wvware stuff

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1082138 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 15 years ago
parent 2f609b5dfa
commit 95b2985759

@ -400,18 +400,18 @@ void Document::generateFrameBorder( QDomElement& frameElementOut, const wvWare::
Conversion::setBorderAttributes( frameElementOut, brcRight, "r" );
// Frame background brush (color and fill style)
if ( shd.icoFore != 0 || shd.icoBack != 0 )
if ( shd.cvFore != 0 || shd.cvBack != 0 )
{
// If ipat = 0 (solid fill), icoBack is the background color.
// But otherwise, icoFore is the one we need to set as bkColor
// (and icoBack is usually white; it's the other colour of the pattern,
// something that we can't set in Qt apparently).
int bkColor = shd.ipat ? shd.icoFore : shd.icoBack;
kdDebug(30513) << "generateFrameBorder: " << " icoFore=" << shd.icoFore << " icoBack=" << shd.icoBack << " ipat=" << shd.ipat << " -> bkColor=" << bkColor << endl;
int bkColor = shd.ipat ? shd.cvFore : shd.cvBack;
kdDebug(30513) << "generateFrameBorder: " << " icoFore=" << shd.cvFore << " icoBack=" << shd.cvBack << " ipat=" << shd.ipat << " -> bkColor=" << bkColor << endl;
// Reverse-engineer MSWord's own hackery: it models various gray levels
// using dithering. But this looks crappy with Qt. So we go back to a QColor.
bool grayHack = ( shd.ipat && shd.icoFore == 1 && shd.icoBack == 8 );
bool grayHack = ( shd.ipat && shd.cvFore == 1 && shd.cvBack == 8 );
if ( grayHack )
{
bool ok;

@ -322,9 +322,9 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo
format.setAttribute( "pos", pos );
format.setAttribute( "len", len );
if ( !refChp || refChp->ico != chp->ico )
if ( !refChp || refChp->cv != chp->cv )
{
QColor color = Conversion::color( chp->ico, -1 );
QColor color = Conversion::color( chp->cv, -1 );
QDomElement colorElem( mainDocument().createElement( "COLOR" ) );
colorElem.setAttribute( "red", color.red() );
colorElem.setAttribute( "blue", color.blue() );
@ -436,11 +436,11 @@ void KWordTextHandler::writeFormat( QDomElement& parentElement, const wvWare::Wo
}
// background color is known as "highlight" in msword
if ( !refChp || refChp->fHighlight != chp->fHighlight || refChp->icoHighlight != chp->icoHighlight ) {
if ( !refChp || refChp->fHighlight != chp->fHighlight || refChp->cvHighlight != chp->cvHighlight ) {
QDomElement bgcolElem( mainDocument().createElement( "TEXTBACKGROUNDCOLOR" ) );
if ( chp->fHighlight )
{
QColor color = Conversion::color( chp->icoHighlight, -1 );
QColor color = Conversion::color( chp->cvHighlight, -1 );
bgcolElem.setAttribute( "red", color.red() );
bgcolElem.setAttribute( "blue", color.blue() );
bgcolElem.setAttribute( "green", color.green() );

Loading…
Cancel
Save