Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 222723 Details for
Bug 308519
xpdf-3.02-r4.ebuild (Update)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
workaround for slow startup of Xpdf in a UTF-8 locale
xpdf-3.02-poppler-toolbar-and-menu-locale.patch (text/plain), 4.83 KB, created by
Juhos Csaba-Zsolt
on 2010-03-08 21:14:58 UTC
(
hide
)
Description:
workaround for slow startup of Xpdf in a UTF-8 locale
Filename:
MIME Type:
Creator:
Juhos Csaba-Zsolt
Created:
2010-03-08 21:14:58 UTC
Size:
4.83 KB
patch
obsolete
>diff -rup xpdf-3.02-poppler.orig/XPDFApp.cc xpdf-3.02-poppler/XPDFApp.cc >--- xpdf-3.02-poppler.orig/XPDFApp.cc 2007-11-16 10:41:21.000000000 +0200 >+++ xpdf-3.02-poppler/XPDFApp.cc 2010-03-06 16:23:51.000000000 +0200 >@@ -87,6 +87,8 @@ struct XPDFAppResources { > String matteColor; > String fullScreenMatteColor; > String initialZoom; >+ String toolbarLocale; >+ String menuLocale; > }; > > static Bool defInstallCmap = False; >@@ -102,7 +104,9 @@ static XtResource xResources[] = { > { "paperColor", "PaperColor", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, paperColor), XtRString, (XtPointer)NULL }, > { "matteColor", "MatteColor", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, matteColor), XtRString, (XtPointer)"gray50" }, > { "fullScreenMatteColor", "FullScreenMatteColor", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, fullScreenMatteColor), XtRString, (XtPointer)"black" }, >- { "initialZoom", "InitialZoom", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, initialZoom), XtRString, (XtPointer)NULL } >+ { "initialZoom", "InitialZoom", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, initialZoom), XtRString, (XtPointer)NULL }, >+ { "toolbarLocale", "ToolbarLocale", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, toolbarLocale), XtRString, (XtPointer)NULL }, >+ { "menuLocale", "MenuLocale", XtRString, sizeof(String), XtOffsetOf(XPDFAppResources, menuLocale), XtRString, (XtPointer)NULL } > }; > > #define nXResources (sizeof(xResources) / sizeof(XtResource)) >@@ -205,6 +209,10 @@ void XPDFApp::getResources() { > } > initialZoom = resources.initialZoom ? new GooString(resources.initialZoom) > : (GooString *)NULL; >+ toolbarLocale = resources.toolbarLocale ? new GooString(resources.toolbarLocale) >+ : (GooString *)NULL; >+ menuLocale = resources.menuLocale ? new GooString(resources.menuLocale) >+ : (GooString *)NULL; > } > > XPDFApp::~XPDFApp() { >@@ -218,6 +226,12 @@ XPDFApp::~XPDFApp() { > if (initialZoom) { > delete initialZoom; > } >+ if (toolbarLocale) { >+ delete toolbarLocale; >+ } >+ if (menuLocale) { >+ delete menuLocale; >+ } > } > > XPDFViewer *XPDFApp::open(GooString *fileName, int page, >diff -rup xpdf-3.02-poppler.orig/XPDFApp.h xpdf-3.02-poppler/XPDFApp.h >--- xpdf-3.02-poppler.orig/XPDFApp.h 2007-11-16 10:41:21.000000000 +0200 >+++ xpdf-3.02-poppler/XPDFApp.h 2010-03-06 16:06:08.000000000 +0200 >@@ -76,6 +76,8 @@ public: > GooString *getInitialZoom() { return initialZoom; } > void setFullScreen(GBool fullScreenA) { fullScreen = fullScreenA; } > GBool getFullScreen() { return fullScreen; } >+ GooString *getToolbarLocale() { return toolbarLocale; } >+ GooString *getMenuLocale() { return menuLocale; } > > XtAppContext getAppContext() { return appContext; } > Widget getAppShell() { return appShell; } >@@ -109,6 +111,8 @@ private: > Gulong fullScreenMattePixel; > GooString *initialZoom; > GBool fullScreen; >+ GooString *toolbarLocale; >+ GooString *menuLocale; > }; > > #endif >diff -rup xpdf-3.02-poppler.orig/XPDFViewer.cc xpdf-3.02-poppler/XPDFViewer.cc >--- xpdf-3.02-poppler.orig/XPDFViewer.cc 2007-11-17 01:23:01.000000000 +0200 >+++ xpdf-3.02-poppler/XPDFViewer.cc 2010-03-06 16:41:59.000000000 +0200 >@@ -15,6 +15,7 @@ > #include <stdlib.h> > #include <string.h> > #include <ctype.h> >+#include <locale.h> > #include <X11/keysym.h> > #include <X11/cursorfont.h> > #ifdef HAVE_X11_XPM_H >@@ -1565,7 +1566,11 @@ void XPDFViewer::initToolbar(Widget pare > int n; > XmString s, emptyString; > int i; >+ char *saved_locale = NULL; > >+ if (app->getToolbarLocale()) { >+ saved_locale = setlocale(LC_CTYPE, app->getToolbarLocale()->getCString()); >+ } > // toolbar > n = 0; > toolBar = XmCreateForm(parent, "toolBar", args, n); >@@ -1822,6 +1827,7 @@ void XPDFViewer::initToolbar(Widget pare > XtManageChild(linkLabel); > > XmStringFree(emptyString); >+ setlocale(LC_CTYPE, saved_locale); > } > > #ifndef DISABLE_OUTLINE >@@ -1882,7 +1888,11 @@ void XPDFViewer::initPopupMenu() { > Arg args[20]; > int n; > XmString s, s2; >+ char *saved_locale = NULL; > >+ if (app->getMenuLocale()) { >+ saved_locale = setlocale(LC_CTYPE, app->getMenuLocale()->getCString()); >+ } > n = 0; > #if XmVersion < 1002 > // older versions of Motif need this, newer ones choke on it, >@@ -2008,6 +2018,7 @@ void XPDFViewer::initPopupMenu() { > // this is magic (taken from DDD) - weird things happen if this > // call isn't made > XtUngrabButton(core->getDrawAreaWidget(), AnyButton, AnyModifier); >+ setlocale(LC_CTYPE, saved_locale); > } > > void XPDFViewer::addToolTip(Widget widget, char *text) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 308519
: 222723 |
222725