rpms/openoffice.org/devel workspace.unifypaper01.patch, NONE, 1.1 openoffice.org.spec, 1.1916, 1.1917
Caolan McNamara
caolanm at fedoraproject.org
Fri May 29 14:27:06 UTC 2009
Author: caolanm
Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv32501
Modified Files:
openoffice.org.spec
Added Files:
workspace.unifypaper01.patch
Log Message:
Resolves: rhbz#451767 get default paper right for all territories
workspace.unifypaper01.patch:
--- NEW FILE workspace.unifypaper01.patch ---
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/i18npool/prj/build.lst OOO310_m12/i18npool/prj/build.lst
--- OOO310_m12.orig/i18npool/prj/build.lst 2009-05-27 14:29:21.000000000 +0100
+++ OOO310_m12/i18npool/prj/build.lst 2009-05-27 14:40:28.000000000 +0100
@@ -9,6 +9,7 @@
inp i18npool\source\isolang nmake - all inp_isolang inp_inc NULL
inp i18npool\source\localedata nmake - all inp_localedata inp_isolang inp_inc NULL
inp i18npool\source\localedata\data nmake - all inp_locdata_data inp_localedata inp_inc NULL
+inp i18npool\source\paper nmake - all inp_paper inp_isolang inp_inc NULL
inp i18npool\source\calendar nmake - all inp_cal inp_inc NULL
inp i18npool\source\numberformatcode nmake - all inp_numformat inp_inc NULL
inp i18npool\source\defaultnumberingprovider nmake - all inp_dnum inp_inc NULL
@@ -22,4 +23,4 @@
inp i18npool\source\textconversion\data nmake - all inp_textconv_dict inp_textconversion inp_inc NULL
inp i18npool\source\search nmake - all inp_search inp_inc NULL
inp i18npool\source\ordinalsuffix nmake - all inp_ordinalsuffix NULL
-inp i18npool\util nmake - all inp_util inp_brkit inp_dict inp_chclass inp_translit inp_cal inp_dnum inp_natnum inp_localedata inp_locdata_data inp_numformat inp_rserv inp_index inp_index_data inp_collator inp_collator_data inp_inputchecker inp_textconversion inp_textconv_dict inp_search inp_isolang inp_ordinalsuffix NULL
+inp i18npool\util nmake - all inp_util inp_brkit inp_dict inp_chclass inp_translit inp_cal inp_dnum inp_natnum inp_localedata inp_locdata_data inp_numformat inp_rserv inp_index inp_index_data inp_collator inp_collator_data inp_inputchecker inp_textconversion inp_textconv_dict inp_search inp_isolang inp_paper inp_ordinalsuffix NULL
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/i18npool/prj/d.lst OOO310_m12/i18npool/prj/d.lst
--- OOO310_m12.orig/i18npool/prj/d.lst 2009-05-27 14:29:21.000000000 +0100
+++ OOO310_m12/i18npool/prj/d.lst 2009-05-27 14:40:28.000000000 +0100
@@ -40,3 +40,9 @@
..\%__SRC%\bin\i18nisol*.dll %_DEST%\bin%_EXT%\i18nisol*.dll
..\%__SRC%\lib\libi18nisolang*.so %_DEST%\lib%_EXT%\libi18nisolang*.so
..\%__SRC%\lib\libi18nisolang*.dylib %_DEST%\lib%_EXT%\libi18nisolang*.dylib
+
+..\%__SRC%\lib\ii18npaper*.lib %_DEST%\lib%_EXT%\ii18npaper*.lib
+..\%__SRC%\bin\i18npaper*.dll %_DEST%\bin%_EXT%\i18npaper*.dll
+..\%__SRC%\lib\libi18npaper*.so %_DEST%\lib%_EXT%\libi18npaper*.so
+..\%__SRC%\lib\libi18npaper*.dylib %_DEST%\lib%_EXT%\libi18npaper*.dylib
+
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/psprint/source/printer/printerinfomanager.cxx OOO310_m12/psprint/source/printer/printerinfomanager.cxx
--- OOO310_m12.orig/psprint/source/printer/printerinfomanager.cxx 2009-05-27 14:26:36.000000000 +0100
+++ OOO310_m12/psprint/source/printer/printerinfomanager.cxx 2009-05-27 15:22:48.000000000 +0100
@@ -43,6 +43,7 @@
#include <psprint/fontmanager.hxx>
#include <psprint/strhelper.hxx>
#include <rtl/strbuf.hxx>
+#include <i18npool/paper.hxx>
#include <osl/thread.hxx>
#include <osl/mutex.hxx>
@@ -156,77 +157,9 @@
void PrinterInfoManager::initSystemDefaultPaper()
{
- bool bSuccess = false;
-
- // try libpaper
-
- // #i78617# workaround missing paperconf command
- FILE* pPipe = popen( "sh -c paperconf 2>/dev/null", "r" );
- if( pPipe )
- {
- char pBuffer[ 1024 ];
- *pBuffer = 0;
- fgets( pBuffer, sizeof(pBuffer)-1, pPipe );
- pclose( pPipe );
-
- ByteString aPaper( pBuffer );
- aPaper = WhitespaceToSpace( aPaper );
- if( aPaper.Len() )
- {
- m_aSystemDefaultPaper = OUString( OStringToOUString( aPaper, osl_getThreadTextEncoding() ) );
- bSuccess = true;
- #if OSL_DEBUG_LEVEL > 1
- fprintf( stderr, "paper from paperconf = %s\n", aPaper.GetBuffer() );
- #endif
- }
- if( bSuccess )
- return;
- }
-
- // default value is Letter for US (en_US), Cannada (en_CA, fr_CA); else A4
- // en will be interpreted as en_US
-
- // note: at this point m_aSystemDefaultPaper is set to "A4" from the constructor
-
- // check for LC_PAPER
- const char* pPaperLang = getenv( "LC_PAPER" );
- if( pPaperLang && *pPaperLang )
- {
- OString aLang( pPaperLang );
- if( aLang.getLength() > 5 )
- aLang = aLang.copy( 0, 5 );
- if( aLang.getLength() == 5 )
- {
- if( aLang.equalsIgnoreAsciiCase( "en_us" )
- || aLang.equalsIgnoreAsciiCase( "en_ca" )
- || aLang.equalsIgnoreAsciiCase( "fr_ca" )
- )
- m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
- }
- else if( aLang.getLength() == 2 && aLang.equalsIgnoreAsciiCase( "en" ) )
- m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
- return;
- }
-
- // use process locale to determine paper
- rtl_Locale* pLoc = NULL;
- osl_getProcessLocale( &pLoc );
- if( pLoc )
- {
- if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Language->buffer, pLoc->Language->length, "en") )
- {
- if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Country->buffer, pLoc->Country->length, "us")
- || 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Country->buffer, pLoc->Country->length, "ca")
- || pLoc->Country->length == 0
- )
- m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
- }
- else if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Language->buffer, pLoc->Language->length, "fr") )
- {
- if( 0 == rtl_ustr_ascii_compareIgnoreAsciiCase_WithLength( pLoc->Country->buffer, pLoc->Country->length, "ca") )
- m_aSystemDefaultPaper = OUString( RTL_CONSTASCII_USTRINGPARAM( "Letter" ) );
- }
- }
+ m_aSystemDefaultPaper = rtl::OStringToOUString(
+ PaperInfo::toPSName(PaperInfo::getSystemDefaultPaper().getPaper()),
+ RTL_TEXTENCODING_UTF8);
}
// -----------------------------------------------------------------
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/psprint/util/makefile.mk OOO310_m12/psprint/util/makefile.mk
--- OOO310_m12.orig/psprint/util/makefile.mk 2009-05-27 14:26:36.000000000 +0100
+++ OOO310_m12/psprint/util/makefile.mk 2009-05-27 15:22:47.000000000 +0100
@@ -67,6 +67,7 @@
SHL1STDLIBS=$(UNOTOOLSLIB) \
$(I18NISOLANGLIB) \
+ $(I18NPAPERLIB) \
$(TOOLSLIB) \
$(COMPHELPERLIB) \
$(CPPULIB) \
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/reportdesign/source/core/api/ReportDefinition.cxx OOO310_m12/reportdesign/source/core/api/ReportDefinition.cxx
--- OOO310_m12.orig/reportdesign/source/core/api/ReportDefinition.cxx 2009-05-27 14:27:46.000000000 +0100
+++ OOO310_m12/reportdesign/source/core/api/ReportDefinition.cxx 2009-05-27 14:40:27.000000000 +0100
@@ -289,7 +289,7 @@
:OStyle_PBASE(m_aBHelper)
,m_aSize(21000,29700)
{
- const ::Size aDefaultSize = SvxPaperInfo::GetPaperSize(SvxPaperInfo::GetDefaultSvxPaper(Application::GetSettings().GetLanguage()),MAP_100TH_MM);
+ const ::Size aDefaultSize = SvxPaperInfo::GetDefaultPaperSize( MAP_100TH_MM );
m_aSize.Height = aDefaultSize.Height();
m_aSize.Width = aDefaultSize.Width();
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/reportdesign/source/ui/report/ReportController.cxx OOO310_m12/reportdesign/source/ui/report/ReportController.cxx
--- OOO310_m12.orig/reportdesign/source/ui/report/ReportController.cxx 2009-05-27 14:27:46.000000000 +0100
+++ OOO310_m12/reportdesign/source/ui/report/ReportController.cxx 2009-05-27 14:40:27.000000000 +0100
@@ -2339,8 +2339,8 @@
new SvxPageItem(RPTUI_ID_PAGE),
new SvxSizeItem(RPTUI_ID_SIZE),
new SfxAllEnumItem(RPTUI_ID_PAGE_MODE,SVX_PAGE_MODE_STANDARD),
- new SfxAllEnumItem(RPTUI_ID_START,SVX_PAPER_A4),
- new SfxAllEnumItem(RPTUI_ID_END,SVX_PAPER_E),
+ new SfxAllEnumItem(RPTUI_ID_START,PAPER_A4),
+ new SfxAllEnumItem(RPTUI_ID_END,PAPER_E),
new SvxBrushItem(ITEMID_BRUSH),
new SfxUInt16Item(RPTUI_ID_METRIC,static_cast<UINT16>(eUserMetric))
};
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/sc/source/core/data/stlsheet.cxx OOO310_m12/sc/source/core/data/stlsheet.cxx
--- OOO310_m12.orig/sc/source/core/data/stlsheet.cxx 2009-05-27 14:26:41.000000000 +0100
+++ OOO310_m12/sc/source/core/data/stlsheet.cxx 2009-05-27 14:40:27.000000000 +0100
@@ -176,14 +176,8 @@
if ( pDoc && pDoc->IsLoadingDone() )
{
// Setzen von sinnvollen Default-Werten:
- // SfxPrinter* pPrinter = pDoc->GetPrinter();
SvxPageItem aPageItem( ATTR_PAGE );
- // #50536# PaperBin auf Default lassen,
- // nicht auf aktuelle Drucker-Einstellung umsetzen
- // SvxSizeItem aPaperSizeItem(ATTR_PAGE_SIZE,SvxPaperInfo::GetPaperSize(pPrinter) );
-
- SvxPaper aDefaultPaper = SvxPaperInfo::GetDefaultSvxPaper( Application::GetSettings().GetLanguage() );
- SvxSizeItem aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetPaperSize(aDefaultPaper) );
+ SvxSizeItem aPaperSizeItem( ATTR_PAGE_SIZE, SvxPaperInfo::GetDefaultPaperSize() );
SvxSetItem aHFSetItem(
(const SvxSetItem&)
diff -ru --exclude='unxlng*.pro' --exclude=localize.sdf OOO310_m12.orig/sc/source/filter/excel/biffdump.cxx OOO310_m12/sc/source/filter/excel/biffdump.cxx
--- OOO310_m12.orig/sc/source/filter/excel/biffdump.cxx 2009-05-27 14:26:42.000000000 +0100
+++ OOO310_m12/sc/source/filter/excel/biffdump.cxx 2009-05-27 14:40:27.000000000 +0100
@@ -9862,3 +9862,9867 @@
#endif
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: biffdump.cxx,v $
+ * $Revision: 1.91 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
[...13981 lines suppressed...]
+ {
+ { "B0", PAPER_B0_ISO },
+ { "B1", PAPER_B1_ISO },
+ { "B2", PAPER_B2_ISO },
+ { "B3", PAPER_B3_ISO },
+ { "B4", PAPER_B4_ISO },
+ { "B5", PAPER_B5_ISO },
+ { "B6", PAPER_B6_ISO },
+ { "B7", PAPER_B7_ISO },
+ { "B8", PAPER_B8_ISO },
+ { "B9", PAPER_B9_ISO },
+ { "B10", PAPER_B10_ISO },
+ { "folio", PAPER_FANFOLD_LEGAL_DE },
+ { "flsa", PAPER_FANFOLD_LEGAL_DE },
+ { "flse", PAPER_FANFOLD_LEGAL_DE }
+ };
+
+ bool bHalve = false;
+
+ size_t nExtraTabSize = sizeof(aCustoms) / sizeof(aCustoms[0]);
+ for (size_t i = 0; i < nExtraTabSize; ++i)
+ {
+ if (rtl_str_compareIgnoreAsciiCase(aCustoms[i].pName, aPaper.getStr()) == 0)
+ {
+ ePaper = aCustoms[i].ePaper;
+ break;
+ }
+ }
+
+ if (ePaper == PAPER_USER)
+ {
+ bHalve = !rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
+ aPaper.getStr(), aPaper.getLength(), "half", 4, 4);
+ if (bHalve)
+ aPaper = aPaper.copy(4);
+ ePaper = PaperInfo::fromPSName(aPaper);
+ }
+
+ if (ePaper != PAPER_USER)
+ {
+ aInstance = PaperInfo(ePaper);
+ if (bHalve)
+ aInstance = PaperInfo(aInstance.getHeight()/2, aInstance.getWidth());
+ bInitialized = true;
+ return aInstance;
+ }
+ }
+ }
+
+#if defined(LC_PAPER) && defined(_GNU_SOURCE)
+
+ union paperword { char *string; int word; };
+
+ // try LC_PAPER
+ paperword w, h;
+ w.string = nl_langinfo(_NL_PAPER_WIDTH);
+ h.string = nl_langinfo(_NL_PAPER_HEIGHT);
+
+ //glibc stores sizes as integer mm units
+ w.word *= 100;
+ h.word *= 100;
+
+ for ( size_t i = 0; i < nTabSize; ++i )
+ {
+ if (i == PAPER_USER) continue;
+
+ //glibc stores sizes as integer mm units, and so is inaccurate. To
+ //find a standard paper size we calculate the standard paper sizes
+ //into equally inaccurate mm and compare
+ long width = (aDinTab[i].m_nWidth + 50) / 100;
+ long height = (aDinTab[i].m_nHeight + 50) / 100;
+
+ if (width == w.word/100 && height == h.word/100)
+ {
+ w.word = aDinTab[i].m_nWidth;
+ h.word = aDinTab[i].m_nHeight;
+ break;
+ }
+ }
+
+ aInstance = PaperInfo(w.word, h.word);
+ bInitialized = true;
+ return aInstance;
+#endif
+ }
+#endif
+
+ try
+ {
+ // if set to "use system", try to get locale from system
+ if( aLocaleStr.getLength() == 0 )
+ xConfigNA->getByName( CREATE_OUSTRING( "Locale" ) ) >>= aLocaleStr;
+ }
+ catch( Exception& ) {}
+
+
+ if (aLocaleStr.getLength() == 0)
+ aLocaleStr = CREATE_OUSTRING("en-US");
+
+ // convert locale string to locale struct
+ ::com::sun::star::lang::Locale aSysLocale;
+ sal_Int32 nDashPos = aLocaleStr.indexOf( '-' );
+ if( nDashPos < 0 ) nDashPos = aLocaleStr.getLength();
+ aSysLocale.Language = aLocaleStr.copy( 0, nDashPos );
+ if( nDashPos + 1 < aLocaleStr.getLength() )
+ aSysLocale.Country = aLocaleStr.copy( nDashPos + 1 );
+
+ return PaperInfo::getDefaultPaperForLocale(aSysLocale);
+}
+
+PaperInfo::PaperInfo(Paper eType) : m_eType(eType)
+{
+ m_nPaperWidth = aDinTab[m_eType].m_nWidth;
+ m_nPaperHeight = aDinTab[m_eType].m_nHeight;
+}
+
+PaperInfo::PaperInfo(long nPaperWidth, long nPaperHeight)
+ : m_eType(PAPER_USER),
+ m_nPaperWidth(nPaperWidth),
+ m_nPaperHeight(nPaperHeight)
+{
+ for ( size_t i = 0; i < nTabSize; ++i )
+ {
+ if (
+ (nPaperWidth == aDinTab[i].m_nWidth) &&
+ (nPaperHeight == aDinTab[i].m_nHeight)
+ )
+ {
+ m_eType = static_cast<Paper>(i);
+ break;
+ }
+ }
+}
+
+rtl::OString PaperInfo::toPSName(Paper ePaper)
+{
+ return static_cast<size_t>(ePaper) < nTabSize ?
+ rtl::OString(aDinTab[ePaper].m_pPSName) : rtl::OString();
+}
+
+Paper PaperInfo::fromPSName(const rtl::OString &rName)
+{
+ if (!rName.getLength())
+ return PAPER_USER;
+
+ for ( size_t i = 0; i < nTabSize; ++i )
+ {
+ if (aDinTab[i].m_pPSName &&
+ !rtl_str_compareIgnoreAsciiCase(aDinTab[i].m_pPSName, rName.getStr()))
+ {
+ return static_cast<Paper>(i);
+ }
+ else if (aDinTab[i].m_pAltPSName &&
+ !rtl_str_compareIgnoreAsciiCase(aDinTab[i].m_pAltPSName, rName.getStr()))
+ {
+ return static_cast<Paper>(i);
+ }
+ }
+
+ return PAPER_USER;
+}
+
+//http://wiki.services.openoffice.org/wiki/DefaultPaperSize
+//http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/localedata/locales/?cvsroot=glibc
+//http://www.unicode.org/cldr/data/charts/supplemental/territory_language_information.html
+//http://en.wikipedia.org/wiki/Paper_size
+//http://msdn.microsoft.com/en-us/library/cc195164.aspx
+PaperInfo PaperInfo::getDefaultPaperForLocale(
+ const ::com::sun::star::lang::Locale & rLocale)
+{
+ Paper eType = PAPER_A4;
+
+ if (
+ //United States, Letter
+ !rLocale.Country.compareToAscii("US") ||
+ //Puerto Rico, http://sources.redhat.com/ml/libc-hacker/2001-07/msg00046.html
+ !rLocale.Country.compareToAscii("PR") ||
+ //Canada, http://sources.redhat.com/ml/libc-hacker/2001-07/msg00053.html
+ !rLocale.Country.compareToAscii("CA") ||
+ //Venuzuela, https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00019.html
+ !rLocale.Country.compareToAscii("VE") ||
+ //Chile, https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00240.html
+ !rLocale.Country.compareToAscii("CL") ||
+ //Mexico, http://qa.openoffice.org/issues/show_bug.cgi?id=49739
+ !rLocale.Country.compareToAscii("MX") ||
+ //Colombia, http://qa.openoffice.org/issues/show_bug.cgi?id=69703
+ !rLocale.Country.compareToAscii("CO") ||
+ //Philippines,
+ // http://ubuntuliving.blogspot.com/2008/07/default-paper-size-in-evince.html
+ // http://www.gov.ph/faqs/driverslicense.asp
+ !rLocale.Country.compareToAscii("PH")
+ )
+ {
+ eType = PAPER_LETTER;
+ }
+
+ return eType;
+}
+
+/* vi:set tabstop=4 shiftwidth=4 expandtab: */
Index: openoffice.org.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.1916
retrieving revision 1.1917
diff -u -p -r1.1916 -r1.1917
--- openoffice.org.spec 28 May 2009 10:02:21 -0000 1.1916
+++ openoffice.org.spec 29 May 2009 14:26:35 -0000 1.1917
@@ -141,6 +141,7 @@ Patch65: openoffice.org-3.1.0.ooo101439.
Patch66: openoffice.org-3.1.0.ooo100469.sal.ia64_arm.patch
Patch67: openoffice.org-3.1.0.ooo101566.svtools.nodefaultwmfwidth.patch
Patch68: openoffice.org-3.1.0.ooo101567.i18npool.mailocaledata.patch
+Patch69: workspace.unifypaper01.patch
%define python_py_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")
%define instdir %{_libdir}
@@ -1641,6 +1642,7 @@ cat %{PATCH11} >> svtools/source/dialogs
%patch66 -p0 -b .ooo100469.sal.ia64_arm.patch
%patch67 -p0 -b .ooo101566.svtools.nodefaultwmfwidth.patch
%patch68 -p0 -b .ooo101567.i18npool.mailocaledata.patch
+%patch69 -p0 -b .workspace.unifypaper01.patch
%build
echo build start time is `date`, diskspace: `df -h . | tail -n 1`
@@ -2968,6 +2970,7 @@ rm -rf $RPM_BUILD_ROOT
%{basisinstdir}/program/libfwm%{SOPOST}.so
%{basisinstdir}/program/libgo%{SOPOST}.so
%{basisinstdir}/program/libi18nisolang*.so
+%{basisinstdir}/program/libi18npaper*.so
%{basisinstdir}/program/libi18nutilgcc3.so
%{basisinstdir}/program/libj%{SOPOST}_g.so
%{basisinstdir}/program/libpackage2.so
@@ -4143,8 +4146,9 @@ fi
unopkg list --shared > /dev/null 2>&1 || :
%changelog
-* Thu May 28 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-12.2
+* Fri May 29 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-12.2
- Resolves: rhbz#503003 silence warnings on updates
+- Resolves: rhbz#451767 get default paper right for all territories
* Tue May 26 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-12.1
- start of 3.1.1 branch
More information about the scm-commits
mailing list