Re: pradeeban - r28043 - abiword/branches/gsoc2009unicode/src/wp/ap/win

From: J.M. Maurer <uwog_at_uwog.net>
Date: Fri Aug 28 2009 - 11:14:50 CEST

On Fri, 2009-08-28 at 08:57 +0200, cvs@abisource.com wrote:
> Author: pradeeban
> Date: 2009-08-28 08:57:23 +0200 (Fri, 28 Aug 2009)
> New Revision: 28043
>
> Modified:
> abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_FormatFootnotes.cpp
> abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.cpp
> abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.h
> abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_PageSetup.cpp
> Log:
> Fixing the smart quotes combo in the Options Dialog.

What does this fix exactly? I'm asking since the Smart Quotes in trunk
on win32 look totally b0rked.

  Marc

>
> Modified: abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_FormatFootnotes.cpp
> ===================================================================
> --- abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_FormatFootnotes.cpp 2009-08-28 05:50:24 UTC (rev 28042)
> +++ abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_FormatFootnotes.cpp 2009-08-28 06:57:23 UTC (rev 28043)
> @@ -120,8 +120,8 @@
> nDefE = i;
> }
>
> - selectComboItem (AP_RID_DIALOG_FORMATFOOTNOTES_COMBO_FSTYLE, 0);
> - selectComboItem (AP_RID_DIALOG_FORMATFOOTNOTES_COMBO_ESTYLE, 0);
> + selectComboItem (AP_RID_DIALOG_FORMATFOOTNOTES_COMBO_FSTYLE, nDefF);
> + selectComboItem (AP_RID_DIALOG_FORMATFOOTNOTES_COMBO_ESTYLE, nDefE);
>
> /*Set Default Radio buttons Footnotes */
> if (getRestartFootnoteOnSection() || getRestartFootnoteOnPage())
>
> Modified: abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.cpp
> ===================================================================
> --- abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.cpp 2009-08-28 05:50:24 UTC (rev 28042)
> +++ abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.cpp 2009-08-28 06:57:23 UTC (rev 28043)
> @@ -452,7 +452,7 @@
> int nCount = SendMessageW(hCombo, CB_GETCOUNT, 0, 0);
> UT_return_if_fail(index >= 0 && index < nCount);
>
> - SendMessageW(hCombo, CB_SETCURSEL, index, 0);
> + selectComboItem(AP_RID_DIALOG_OPTIONS_COMBO_OUTERQUOTE, index);
> }
>
> void AP_Win32Dialog_Options::_setInnerQuoteStyle(const gint index)
> @@ -463,15 +463,12 @@
> int nCount = SendMessageW(hCombo, CB_GETCOUNT, 0, 0);
> UT_return_if_fail(index >= 0 && index < nCount);
>
> - SendMessageW(hCombo, CB_SETCURSEL, index, 0);
> + selectComboItem (AP_RID_DIALOG_OPTIONS_COMBO_INNERQUOTE, index);
> }
>
> gint AP_Win32Dialog_Options::_gatherOuterQuoteStyle()
> {
> - HWND hCombo = GetDlgItem((HWND)getPage(PG_SMARTQUOTES), AP_RID_DIALOG_OPTIONS_COMBO_OUTERQUOTE);
> - UT_return_val_if_fail(hCombo, 0);
> -
> - int nIndex = SendMessageW(hCombo, CB_GETCURSEL , 0,0);
> + int nIndex = getComboSelectedIndex(AP_RID_DIALOG_OPTIONS_COMBO_OUTERQUOTE);
> UT_return_val_if_fail(nIndex != CB_ERR, 0);
>
> return nIndex;
> @@ -479,10 +476,7 @@
>
> gint AP_Win32Dialog_Options::_gatherInnerQuoteStyle()
> {
> - HWND hCombo = GetDlgItem((HWND)getPage(PG_SMARTQUOTES), AP_RID_DIALOG_OPTIONS_COMBO_INNERQUOTE);
> - UT_return_val_if_fail(hCombo, 0);
> -
> - int nIndex = SendMessageW(hCombo, CB_GETCURSEL , 0,0);
> + int nIndex = getComboSelectedIndex(AP_RID_DIALOG_OPTIONS_COMBO_INNERQUOTE);
> UT_return_val_if_fail(nIndex != CB_ERR, 0);
>
> return nIndex;
> @@ -921,12 +915,7 @@
> _DS2(OPTIONS_CHK_CustomSmartQuotes, DLG_Options_Label_CustomSmartQuotes);
> _DS2(OPTIONS_LBL_OuterQuoteStyle, DLG_Options_Label_OuterQuoteStyle);
> _DS2(OPTIONS_LBL_InnerQuoteStyle, DLG_Options_Label_InnerQuoteStyle);
> -
> - HWND hComboOuter = GetDlgItem(getHandle(), AP_RID_DIALOG_OPTIONS_COMBO_OUTERQUOTE);
> - UT_return_if_fail(hComboOuter);
> - HWND hComboInner = GetDlgItem(getHandle(), AP_RID_DIALOG_OPTIONS_COMBO_INNERQUOTE);
> - UT_return_if_fail(hComboInner);
> -
> +
> UT_UCSChar buf[4];
>
> for(size_t i = 0; XAP_EncodingManager::smartQuoteStyles[i].leftQuote != (UT_UCSChar)0; i++)
> @@ -936,18 +925,17 @@
> buf[2] = XAP_EncodingManager::smartQuoteStyles[i].rightQuote;
> buf[3] = NULL;
>
> - gchar *szDisplayString = g_ucs4_to_utf8(buf, -1, NULL, NULL, NULL);
> + LPSTR szDisplayString = g_ucs4_to_utf8(buf, -1, NULL, NULL, NULL);
> if(szDisplayString)
> - {
> - UT_String tmp = AP_Win32App::s_fromUTF8ToWinLocale(szDisplayString);
> - SendMessageW(hComboOuter, CB_ADDSTRING, 0, (LPARAM)tmp.c_str());
> - SendMessageW(hComboInner, CB_ADDSTRING, 0, (LPARAM)tmp.c_str());
> + {
> + addItemToCombo( AP_RID_DIALOG_OPTIONS_COMBO_OUTERQUOTE, szDisplayString);
> + addItemToCombo( AP_RID_DIALOG_OPTIONS_COMBO_INNERQUOTE, szDisplayString);
> +
> FREEP(szDisplayString);
> }
> }
> }
>
> -
> /*
>
> */
>
> Modified: abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.h
> ===================================================================
> --- abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.h 2009-08-28 05:50:24 UTC (rev 28042)
> +++ abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_Options.h 2009-08-28 06:57:23 UTC (rev 28043)
> @@ -26,6 +26,7 @@
> #include "ap_Dialog_Options.h"
> #include "xap_Win32PropertySheet.h"
> #include "xap_Frame.h"
> +#include "xap_Win32DialogBase.h"
>
>
> class UT_String;
> @@ -158,7 +159,7 @@
>
>
> /*****************************************************************/
> -class ABI_EXPORT AP_Win32Dialog_Options: public AP_Dialog_Options
> +class ABI_EXPORT AP_Win32Dialog_Options: public AP_Dialog_Options, public XAP_Win32DialogBase
> {
> public:
> AP_Win32Dialog_Options(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id);
> @@ -250,7 +251,6 @@
> BOOL _onNotify(HWND hWnd, LPARAM lParam);
> BOOL _onCommandTab(HWND hWnd, WPARAM wParam, LPARAM lParam);
>
> - HWND m_hwndDlg; // parent dialog
> HWND m_hwndTab; // tab control in parent dialog
>
> int m_nrSubDlgs; // number of tabs on tab control
>
> Modified: abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_PageSetup.cpp
> ===================================================================
> --- abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_PageSetup.cpp 2009-08-28 05:50:24 UTC (rev 28042)
> +++ abiword/branches/gsoc2009unicode/src/wp/ap/win/ap_Win32Dialog_PageSetup.cpp 2009-08-28 06:57:23 UTC (rev 28043)
> @@ -454,7 +454,7 @@
> m_pParent->updatePageSize();
>
> int nUnit = m_pParent->getPageUnits();
> - selectComboItem (AP_RID_DIALOG_PAGE_SETUP_LBX_UNITS, (LPARAM) 0 );
> + selectComboItem (AP_RID_DIALOG_PAGE_SETUP_LBX_UNITS, (WPARAM) nUnit );
>
> // Load Appropriate XPM to BMPs
> COLORREF ColorRef = GetSysColor(COLOR_BTNFACE);
> @@ -661,8 +661,8 @@
> addItemToCombo (AP_RID_DIALOG_PAGE_SETUP_LBX_MARGINUNITS, _GVX(DLG_Unit_cm));
> addItemToCombo (AP_RID_DIALOG_PAGE_SETUP_LBX_MARGINUNITS, _GVX(DLG_Unit_mm));
> // Initialize Data
> - selectComboItem (AP_RID_DIALOG_PAGE_SETUP_LBX_MARGINUNITS, (LPARAM) 0 );
> - SetWindowLong(getHandle(), GWL_USERDATA, (LONG)this);
> + selectComboItem (AP_RID_DIALOG_PAGE_SETUP_LBX_MARGINUNITS, (WPARAM) m_pParent->getMarginUnits() );
> + SetWindowLongW(getHandle(), GWL_USERDATA, (LONG)this);
> }
>
> int CALLBACK AP_Win32Dialog_PageSetup_Margin::s_pageWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
>
> -----------------------------------------------
> To unsubscribe from this list, send a message to
> abisource-cvs-commit-request@abisource.com with the word
> unsubscribe in the message body.
Received on Fri Aug 28 11:20:18 2009

This archive was generated by hypermail 2.1.8 : Fri Aug 28 2009 - 11:20:18 CEST