Re: ib - r31882 - abiword/trunk/src/af/gr/xp

Jean Brefort <[email protected]>
Newsgroups gmane.editors.abiword.devel
Message-ID <[email protected]>
This code was not obsolete. It is used by the mathview plugin. Please be
more careful before removing code.

Jean

Le mercredi 05 septembre 2012 à 12:33 +0200, [email protected] a écrit :
> Author: ib
> Date: 2012-09-05 12:33:28 +0200 (Wed, 05 Sep 2012)
> New Revision: 31882
> 
> Modified:
>    abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp
>    abiword/trunk/src/af/gr/xp/gr_CairoGraphics.h
> Log:
> Get rid of the Symbol/Dingbats to Unicode converting functions.
> 
> They are obsolete after r31870-r31872.
> 
> 
> Modified: abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp
> ===================================================================
> --- abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp	2012-09-05 10:24:33 UTC (rev 31881)
> +++ abiword/trunk/src/af/gr/xp/gr_CairoGraphics.cpp	2012-09-05 10:33:28 UTC (rev 31882)
> @@ -61,9 +61,6 @@
>  }
>  #endif
>  
> -UT_uint32 adobeDingbatsToUnicode(UT_uint32 iAdobe);
> -UT_uint32 adobeToUnicode(UT_uint32 iAdobe);
> -
>  UT_uint32      GR_CairoGraphics::s_iInstanceCount = 0;
>  UT_VersionInfo GR_CairoGraphics::s_Version;
>  int            GR_CairoGraphics::s_iMaxScript = 0;
> @@ -366,8 +363,6 @@
>  	m_capStyle(CAP_BUTT),
>  	m_lineStyle(LINE_SOLID),
>  	m_linePropsDirty(false),
> -	m_bIsSymbol(false),
> -	m_bIsDingbat(false),
>  	m_iPrevX1(0),
>  	m_iPrevX2(0),
>  	m_iPrevY1(0),
> @@ -402,8 +397,6 @@
>  	m_capStyle(CAP_BUTT),
>  	m_lineStyle(LINE_SOLID),
>  	m_linePropsDirty(false),
> -	m_bIsSymbol(false),
> -	m_bIsDingbat(false),
>  	m_iPrevX1(0),
>  	m_iPrevX2(0),
>  	m_iPrevY1(0),
> @@ -771,7 +764,6 @@
>  
>  	GR_PangoRenderInfo * RI = (GR_PangoRenderInfo *)ri;
>  
> -	// need this so that isSymbol() and isDingbat() are correct
>  	setFont(si.m_pFont);
>  
>  	/*
> @@ -809,11 +801,6 @@
>  	{
>  		UT_return_val_if_fail(si.m_Text.getStatus() == UTIter_OK, false);
>  		UT_UCS4Char c = si.m_Text.getChar();
> -		if(isSymbol())
> -			utf8 += adobeToUnicode(c);
> -		else if(isDingbat())
> -			utf8 += adobeDingbatsToUnicode(c);
> -		else {
>  			
>  			if (si.m_TextTransform == GR_ShapingInfo::LOWERCASE)
>  				c = g_unichar_tolower(c);
> @@ -827,7 +814,6 @@
>  			
>  			utf8 += c;
>  			previousWasSpace = g_unichar_isspace(c);
> -		}
>  
>  		if (pfs)
>  		{
> @@ -2067,14 +2053,6 @@
>  	for(i = 0; i < RI.m_iLength; ++i, ++(*(RI.m_pText)))
>  	{
>  		UT_return_val_if_fail(RI.m_pText->getStatus() == UTIter_OK, 0);
> -		if(isSymbol())
> -		{
> -			utf8 += adobeToUnicode(RI.m_pText->getChar());
> -		}
> -		else if(isDingbat())
> -		{
> -			utf8 += adobeDingbatsToUnicode(RI.m_pText->getChar());
> -		}
>  		utf8 += RI.m_pText->getChar();
>  	}
>  	
> @@ -2135,14 +2113,6 @@
>  	for(i = 0; i < RI.m_iLength; ++i, ++(*(RI.m_pText)))
>  	{
>  		UT_return_if_fail(RI.m_pText->getStatus() == UTIter_OK);
> -		if(isSymbol())
> -		{
> -			utf8 += adobeToUnicode(RI.m_pText->getChar());
> -		}
> -		else if(isDingbat())
> -		{
> -			utf8 += adobeDingbatsToUnicode(RI.m_pText->getChar());
> -		}
>  		utf8 += RI.m_pText->getChar();
>  	}
>  
> @@ -2208,25 +2178,7 @@
>  		return;
>  	_setProps();
>  	UT_UTF8String utf8;
> -	xxx_UT_DEBUGMSG(("isDingBat %d \n",isDingbat()));
> -	if(isSymbol())
> -	{
> -		for(int i = iCharOffset; i < iCharOffset + iLength; ++i)
> -		{
> -			utf8 += adobeToUnicode(pChars[i]);
> -		}
> -	}
> -	else if(isDingbat())
> -	{
> -		for(int i = iCharOffset; i < iCharOffset + iLength; ++i)
> -		{
> -			utf8 += adobeDingbatsToUnicode(pChars[i]);
> -		}
> -	}
> -	else
> -	{
>  		utf8.appendUCS4(pChars + iCharOffset, iLength);
> -	}
>  
>  	// this function expect indexes in bytes !!! (stupid)
>  	GList * pItems = pango_itemize(getContext(),
> @@ -2345,24 +2297,7 @@
>  	if (!iLength || iLength <= iCharOffset)
>  		return 0;
>  	
> -	if(isSymbol())
> -	{
> -		for(int i = iCharOffset; i < iCharOffset + iLength; ++i)
> -		{
> -			utf8 += adobeToUnicode(pChars[i]);
> -		}
> -	}
> -	else if(isDingbat())
> -	{
> -		for(int i = iCharOffset; i < iCharOffset + iLength; ++i)
> -		{
> -			utf8 += adobeDingbatsToUnicode(pChars[i]);
> -		}
> -	}
> -	else
> -	{
>  		utf8.appendUCS4(pChars + iCharOffset, iLength);
> -	}
>  
>  	// this function expect indexes in bytes !!! (stupid)
>  	GList * pItems = pango_itemize(getLayoutContext(),
> @@ -2586,33 +2521,6 @@
>  	//PangoFont * pf = (PangoFont*) pFont;
>  	m_pPFont = const_cast<GR_PangoFont*>(static_cast<const GR_PangoFont*>(pFont));
>  
> -	_setIsSymbol(false);
> -	_setIsDingbat(false);
> -
> -	const char* familyName = m_pPFont->getFamily();
> -
> -	char * szLCFontName = familyName ? g_utf8_strdown (familyName, -1) : NULL;
> -
> -	if (szLCFontName)
> -	{
> -		xxx_UT_DEBUGMSG(("GR_CairoGraphics::setFont: %s\n", szLCFontName));
> -		if(strstr(szLCFontName,"symbol") != NULL)
> -		{
> -			/*
> -			 * I am not too happy about this, and do not want to see the exception
> -			 * list to grow much more, but cannot think of another simple solution.
> -			 */
> -			if(!strstr(szLCFontName,"starsymbol") &&
> -			   !strstr(szLCFontName,"opensymbol") &&
> -			   !strstr(szLCFontName,"symbolnerve"))
> -				_setIsSymbol(true);
> -		}
> -		
> -		if(strstr(szLCFontName,"dingbat"))
> -			_setIsDingbat(true);
> -		FREEP(szLCFontName);
> -	}
> -		
>  	if(!m_pPFont->isGuiFont() && m_pPFont->getZoom() != getZoomPercentage())
>  	{
>  		m_pPFont->reloadFont(this);
> @@ -3846,100 +3754,6 @@
>  }
>  
> 
> -UT_uint32 adobeToUnicode(UT_uint32 c)
> -{
> -	/*
> -	 * generated from
> -	 * http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/symbol.txt
> -	 * maps Adobe Symbol Encoding to Unicode
> -	 */
> -	static const UT_uint32 map[256] = {
> -		/* 0x00 */      0,     0,     0,     0,     0,     0,     0,     0,
> -				0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0x10 */      0,     0,     0,     0,     0,     0,     0,     0,
> -				0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0x20 */ 0x0020,0x0021,0x2200,0x0023,0x2203,0x0025,0x0026,0x220B,
> -			   0x0028,0x0029,0x2217,0x002B,0x002C,0x2212,0x002E,0x002F,
> -		/* 0x30 */ 0x0030,0x0031,0x0032,0x0033,0x0034,0x0035,0x0036,0x0037,
> -			   0x0038,0x0039,0x003A,0x003B,0x003C,0x003D,0x003E,0x003F,
> -		/* 0x40 */ 0x2245,0x0391,0x0392,0x03A7,0x0394,0x0395,0x03A6,0x0393,
> -			   0x0397,0x0399,0x03D1,0x039A,0x039B,0x039C,0x039D,0x039F,
> -		/* 0x50 */ 0x03A0,0x0398,0x03A1,0x03A3,0x03A4,0x03A5,0x03C2,0x03A9,
> -			   0x039E,0x03A8,0x0396,0x005B,0x2234,0x005D,0x22A5,0x005F,
> -		/* 0x60 */ 0xF8E5,0x03B1,0x03B2,0x03C7,0x03B4,0x03B5,0x03C6,0x03B3,
> -			   0x03B7,0x03B9,0x03D5,0x03BA,0x03BB,0x00B5,0x03BD,0x03BF,
> -		/* 0x70 */ 0x03C0,0x03B8,0x03C1,0x03C3,0x03C4,0x03C5,0x03D6,0x03C9,
> -			   0x03BE,0x03C8,0x03B6,0x007B,0x007C,0x007D,0x223C,     0,
> -		/* 0x80 */      0,     0,     0,     0,     0,     0,     0,     0,
> -				0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0x90 */      0,     0,     0,     0,     0,     0,     0,     0,
> -				0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0xA0 */ 0x20AC,0x03D2,0x2032,0x2264,0x2044,0x221E,0x0192,0x2663,
> -			   0x2666,0x2665,0x2660,0x2194,0x2190,0x2191,0x2192,0x2193,
> -		/* 0xB0 */ 0x00B0,0x00B1,0x2033,0x2265,0x00D7,0x221D,0x2202,0x2022,
> -			   0x00F7,0x2260,0x2261,0x2248,0x2026,0xF8E6,0xF8E7,0x21B5,
> -		/* 0xC0 */ 0x2135,0x2111,0x211C,0x2118,0x2297,0x2295,0x2205,0x2229,
> -			   0x222A,0x2283,0x2287,0x2284,0x2282,0x2286,0x2208,0x2209,
> -		/* 0xD0 */ 0x2220,0x2207,0xF6DA,0xF6D9,0xF6DB,0x220F,0x221A,0x22C5,
> -			   0x00AC,0x2227,0x2228,0x21D4,0x21D0,0x21D1,0x21D2,0x21D3,
> -		/* 0xE0 */ 0x25CA,0x2329,0xF8E8,0xF8E9,0xF8EA,0x2211,0xF8EB,0xF8EC,
> -			   0xF8ED,0xF8EE,0xF8EF,0xF8F0,0xF8F1,0xF8F2,0xF8F3,0xF8F4,
> -		/* 0xF0 */      0,0x232A,0x222B,0x2320,0xF8F5,0x2321,0xF8F6,0xF8F7,
> -			   0xF8F8,0xF8F9,0xF8FA,0xF8FB,0xF8FC,0xF8FD,0xF8FE,     0,
> -		};
> -	if (c <= 0xFF && map[c] != 0)
> -		return map[c];
> -	else
> -		return c;
> -}
> -
> -UT_uint32 adobeDingbatsToUnicode(UT_uint32 c)
> -{
> -	/*
> -	 * generated from
> -	 * http://www.unicode.org/Public/MAPPINGS/VENDORS/ADOBE/zdingbat.txt
> -	 * maps Adobe Zapf Dingbats Encoding to Unicode
> -	 */
> -	static const UT_uint32 map[256] = {
> -		/* 0x00 */      0,     0,     0,     0,     0,     0,     0,     0,
> -		                0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0x10 */      0,     0,     0,     0,     0,     0,     0,     0,
> -		                0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0x20 */ 0x0020,0x2701,0x2702,0x2703,0x2704,0x260E,0x2706,0x2707,
> -		           0x2708,0x2709,0x261B,0x261E,0x270C,0x270D,0x270E,0x270F,
> -		/* 0x30 */ 0x2710,0x2711,0x2712,0x2713,0x2714,0x2715,0x2716,0x2717,
> -		           0x2718,0x2719,0x271A,0x271B,0x271C,0x271D,0x271E,0x271F,
> -		/* 0x40 */ 0x2720,0x2721,0x2722,0x2723,0x2724,0x2725,0x2726,0x2727,
> -		           0x2605,0x2729,0x272A,0x272B,0x272C,0x272D,0x272E,0x272F,
> -		/* 0x50 */ 0x2730,0x2731,0x2732,0x2733,0x2734,0x2735,0x2736,0x2737,
> -		           0x2738,0x2739,0x273A,0x273B,0x273C,0x273D,0x273E,0x273F,
> -		/* 0x60 */ 0x2740,0x2741,0x2742,0x2743,0x2744,0x2745,0x2746,0x2747,
> -		           0x2748,0x2749,0x274A,0x274B,0x25CF,0x274D,0x25A0,0x274F,
> -		/* 0x70 */ 0x2750,0x2751,0x2752,0x25B2,0x25BC,0x25C6,0x2756,0x25D7,
> -		           0x2758,0x2759,0x275A,0x275B,0x275C,0x275D,0x275E,     0,
> -		/* 0x80 */ 0xF8D7,0xF8D8,0xF8D9,0xF8DA,0xF8DB,0xF8DC,0xF8DD,0xF8DE,
> -		           0xF8DF,0xF8E0,0xF8E1,0xF8E2,0xF8E3,0xF8E4,     0,     0,
> -		/* 0x90 */      0,     0,     0,     0,     0,     0,     0,     0,
> -		                0,     0,     0,     0,     0,     0,     0,     0,
> -		/* 0xA0 */      0,0x2761,0x2762,0x2763,0x2764,0x2765,0x2766,0x2767,
> -		           0x2663,0x2666,0x2665,0x2660,0x2460,0x2461,0x2462,0x2463,
> -		/* 0xB0 */ 0x2464,0x2465,0x2466,0x2467,0x2468,0x2469,0x2776,0x2777,
> -		           0x2778,0x2779,0x277A,0x277B,0x277C,0x277D,0x277E,0x277F,
> -		/* 0xC0 */ 0x2780,0x2781,0x2782,0x2783,0x2784,0x2785,0x2786,0x2787,
> -		           0x2788,0x2789,0x278A,0x278B,0x278C,0x278D,0x278E,0x278F,
> -		/* 0xD0 */ 0x2790,0x2791,0x2792,0x2793,0x2794,0x2192,0x2194,0x2195,
> -		           0x2798,0x2799,0x279A,0x279B,0x279C,0x279D,0x279E,0x279F,
> -		/* 0xE0 */ 0x27A0,0x27A1,0x27A2,0x27A3,0x27A4,0x27A5,0x27A6,0x27A7,
> -		           0x27A8,0x27A9,0x27AA,0x27AB,0x27AC,0x27AD,0x27AE,0x27AF,
> -		/* 0xF0 */      0,0x27B1,0x27B2,0x27B3,0x27B4,0x27B5,0x27B6,0x27B7,
> -		           0x27B8,0x27B9,0x27BA,0x27BB,0x27BC,0x27BD,0x27BE,     0,
> -		};
> -	if (c <= 0xFF && map[c] != 0)
> -		return map[c];
> -	else
> -		return c;
> -}
> -
>  void GR_Font::s_getGenericFontProperties(const char * /*szFontName*/,
>  										 FontFamilyEnum * pff,
>  										 FontPitchEnum * pfp,
> 
> Modified: abiword/trunk/src/af/gr/xp/gr_CairoGraphics.h
> ===================================================================
> --- abiword/trunk/src/af/gr/xp/gr_CairoGraphics.h	2012-09-05 10:24:33 UTC (rev 31881)
> +++ abiword/trunk/src/af/gr/xp/gr_CairoGraphics.h	2012-09-05 10:33:28 UTC (rev 31882)
> @@ -260,9 +260,6 @@
>  	virtual void		invertRect(const UT_Rect* pRect);
>  	virtual void		drawLine(UT_sint32, UT_sint32, UT_sint32, UT_sint32);
>  
> -	bool isDingbat(void) const {return m_bIsDingbat;}
> -	bool isSymbol(void) const {return m_bIsSymbol;};
> -
>  	void resetFontMapResolution(void);
>  
>  	virtual GR_Font* _findFont(const char* pszFontFamily,
> @@ -363,9 +360,6 @@
>  										   UT_BidiCharType iVisDir,
>  										   const char * pUtf8);
>  
> -	void         _setIsSymbol(bool b) {m_bIsSymbol = b;}
> -	void         _setIsDingbat(bool b) {m_bIsDingbat = b;}
> -
>  	PangoFont *  _adjustedPangoFont (GR_PangoFont * pFont, PangoFont * pf);
>  	PangoFont *  _adjustedLayoutPangoFont (GR_PangoFont * pFont, PangoFont * pf);
>  
> @@ -406,8 +400,6 @@
>  	GR_Graphics::CapStyle  m_capStyle;
>  	GR_Graphics::LineStyle m_lineStyle;
>  	bool            m_linePropsDirty;
> -	bool                    m_bIsSymbol;
> -	bool                    m_bIsDingbat;
>  	UT_sint32               m_iPrevX1;
>  	UT_sint32               m_iPrevX2;
>  	UT_sint32               m_iPrevY1;
> 
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> [email protected] with the word
> unsubscribe in the message body.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.