From baac41fc1e52c2902feabf778915195042b196b0 Mon Sep 17 00:00:00 2001 From: xue <> Date: Fri, 3 Feb 2006 07:06:11 +0000 Subject: Fixed an issue about style merging. --- framework/Web/UI/WebControls/TFont.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'framework/Web/UI/WebControls/TFont.php') diff --git a/framework/Web/UI/WebControls/TFont.php b/framework/Web/UI/WebControls/TFont.php index d958c0ee..51d864c3 100644 --- a/framework/Web/UI/WebControls/TFont.php +++ b/framework/Web/UI/WebControls/TFont.php @@ -209,27 +209,27 @@ class TFont extends TComponent /** * Merges the font with a new one. - * If a style field is not set in the current style but set in the new style - * it will take the value from the new style. + * If a font field is set in the new font, the current font field + * will be overwritten. * @param TFont the new font */ public function mergeWith($font) { if($font===null || $font->_flags===0) return; - if(($font->_flags & self::IS_SET_BOLD) && !($this->_flags & self::IS_SET_BOLD)) + if($font->_flags & self::IS_SET_BOLD) $this->setBold($font->getBold()); - if(($font->_flags & self::IS_SET_ITALIC) && !($this->_flags & self::IS_SET_ITALIC)) + if($font->_flags & self::IS_SET_ITALIC) $this->setItalic($font->getItalic()); - if(($font->_flags & self::IS_SET_OVERLINE) && !($this->_flags & self::IS_SET_OVERLINE)) + if($font->_flags & self::IS_SET_OVERLINE) $this->setOverline($font->getOverline()); - if(($font->_flags & self::IS_SET_STRIKEOUT) && !($this->_flags & self::IS_SET_STRIKEOUT)) + if($font->_flags & self::IS_SET_STRIKEOUT) $this->setStrikeout($font->getStrikeout()); - if(($font->_flags & self::IS_SET_UNDERLINE) && !($this->_flags & self::IS_SET_UNDERLINE)) + if($font->_flags & self::IS_SET_UNDERLINE) $this->setUnderline($font->getUnderline()); - if(($font->_flags & self::IS_SET_SIZE) && !($this->_flags & self::IS_SET_SIZE)) + if($font->_flags & self::IS_SET_SIZE) $this->setSize($font->getSize()); - if(($font->_flags & self::IS_SET_NAME) && !($this->_flags & self::IS_SET_NAME)) + if($font->_flags & self::IS_SET_NAME) $this->setName($font->getName()); } -- cgit v1.2.3