[PATCH] Remove SO52 strict compatibility stuff

Christina Rossmanith ChrRossmanith at web.de
Mon Mar 5 05:57:30 PST 2012


---
 vcl/generic/print/common_gfx.cxx |    3 +-
 vcl/generic/print/genprnpsp.cxx  |   36 ---------------
 vcl/generic/print/printerjob.cxx |   89 +-------------------------------------
 vcl/generic/print/text_gfx.cxx   |   42 ------------------
 vcl/headless/svpprn.cxx          |   11 -----
 vcl/inc/generic/printergfx.hxx   |    3 -
 6 files changed, 2 insertions(+), 182 deletions(-)

diff --git a/vcl/generic/print/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx
index 941a5cc..44bf1a7 100644
--- a/vcl/generic/print/common_gfx.cxx
+++ b/vcl/generic/print/common_gfx.cxx
@@ -129,8 +129,7 @@ PrinterGfx::PrinterGfx() :
         maFillColor (0xff,0,0),
         maTextColor (0,0,0),
         maLineColor (0, 0xff, 0),
-        mpFontSubstitutes( NULL ),
-        mbStrictSO52Compatibility( false )
+        mpFontSubstitutes( NULL )
 {
     maVirtualStatus.mfLineWidth = 1.0;
     maVirtualStatus.mnTextHeight = 12;
diff --git a/vcl/generic/print/genprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx
index a456517..64f86b3 100644
--- a/vcl/generic/print/genprnpsp.cxx
+++ b/vcl/generic/print/genprnpsp.cxx
@@ -415,18 +415,6 @@ void SalGenericInstance::configurePspInfoPrinter(PspSalInfoPrinter *pPrinter,
         pJobSetup->maPrinterName    = pQueueInfo->maPrinterName;
         pJobSetup->maDriver         = aInfo.m_aDriverName;
         copyJobDataToJobSetup( pJobSetup, aInfo );
-
-        // set/clear backwards compatibility flag
-        bool bStrictSO52Compatibility = false;
-        boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
-            pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
-
-        if( compat_it != pJobSetup->maValueMap.end() )
-        {
-            if( compat_it->second.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) )
-                bStrictSO52Compatibility = true;
-        }
-        pPrinter->m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
     }
 }
 
@@ -629,18 +617,6 @@ sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup )
 // should be merged into the independent data
 sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup )
 {
-    // set/clear backwards compatibility flag
-    bool bStrictSO52Compatibility = false;
-    boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
-        pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
-
-    if( compat_it != pJobSetup->maValueMap.end() )
-    {
-        if( compat_it->second.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) )
-            bStrictSO52Compatibility = true;
-    }
-    m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
-
     if( pJobSetup->mpDriverData )
         return SetData( ~0, pJobSetup );
 
@@ -993,18 +969,6 @@ sal_Bool PspSalPrinter::StartJob(
 #endif
     m_aPrinterGfx.Init( m_aJobData );
 
-    // set/clear backwards compatibility flag
-    bool bStrictSO52Compatibility = false;
-    boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
-        pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
-
-    if( compat_it != pJobSetup->maValueMap.end() )
-    {
-        if( compat_it->second.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) )
-            bStrictSO52Compatibility = true;
-    }
-    m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
-
     return m_aPrintJob.StartJob( ! m_aTmpFile.isEmpty() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? sal_True : sal_False;
 }
 
diff --git a/vcl/generic/print/printerjob.cxx b/vcl/generic/print/printerjob.cxx
index 503d7af..4cf9efc 100644
--- a/vcl/generic/print/printerjob.cxx
+++ b/vcl/generic/print/printerjob.cxx
@@ -977,94 +977,7 @@ bool PrinterJob::writeProlog (osl::File* pFile, const JobData& rJobData )
         "%%EndResource\n"
         "%%EndProlog\n"
     };
-    static const sal_Char pSO52CompatProlog[] = {
-        "%%BeginResource: procset PSPrint-Prolog 1.0 0\n"
-        "/ISO1252Encoding [\n"
-        "/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n"
-        "/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n"
-        "/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n"
-        "/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef\n"
-        "/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright\n"
-        "/parenleft /parenright /asterisk /plus /comma /minus /period /slash\n"
-        "/zero /one /two /three /four /five /six /seven\n"
-        "/eight /nine /colon /semicolon /less /equal /greater /question\n"
-        "/at /A /B /C /D /E /F /G\n"
-        "/H /I /J /K /L /M /N /O\n"
-        "/P /Q /R /S /T /U /V /W\n"
-        "/X /Y /Z /bracketleft /backslash /bracketright /asciicircum /underscore\n"
-        "/grave /a /b /c /d /e /f /g\n"
-        "/h /i /j /k /l /m /n /o\n"
-        "/p /q /r /s /t /u /v /w\n"
-        "/x /y /z /braceleft /bar /braceright /asciitilde /unused\n"
-        "/Euro /unused /quotesinglbase /florin /quotedblbase /ellipsis /dagger /daggerdbl\n"
-        "/circumflex /perthousand /Scaron /guilsinglleft /OE /unused /Zcaron /unused\n"
-        "/unused /quoteleft /quoteright /quotedblleft /quotedblright /bullet /endash /emdash\n"
-        "/tilde /trademark /scaron /guilsinglright /oe /unused /zcaron /Ydieresis\n"
-        "/space /exclamdown /cent /sterling /currency /yen /brokenbar /section\n"
-        "/dieresis /copyright /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron\n"
-        "/degree /plusminus /twosuperior /threesuperior /acute /mu /paragraph /periodcentered\n"
-        "/cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf /threequarters /questiondown\n"
-        "/Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla\n"
-        "/Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis\n"
-        "/Eth /Ntilde /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply\n"
-        "/Oslash /Ugrave /Uacute /Ucircumflex /Udieresis /Yacute /Thorn /germandbls\n"
-        "/agrave /aacute /acircumflex /atilde /adieresis /aring /ae /ccedilla\n"
-        "/egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis\n"
-        "/eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide\n"
-        "/oslash /ugrave /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] def\n"
-        "\n"
-        "/psp_definefont { exch dup findfont dup length dict begin { 1 index /FID ne\n"
-        "{ def } { pop pop } ifelse } forall /Encoding 3 -1 roll def\n"
-        "currentdict end exch pop definefont pop } def\n"
-        "\n"
-        "/pathdict dup 8 dict def load begin\n"
-        "/rcmd { { currentfile 1 string readstring pop 0 get dup 32 gt { exit }\n"
-        "{ pop } ifelse } loop dup 126 eq { pop exit } if 65 sub dup 16#3 and 1\n"
-        "add exch dup 16#C and -2 bitshift 16#3 and 1 add exch 16#10 and 16#10\n"
-        "eq 3 1 roll exch } def\n"
-        "/rhex { dup 1 sub exch currentfile exch string readhexstring pop dup 0\n"
-        "get dup 16#80 and 16#80 eq dup 3 1 roll { 16#7f and } if 2 index 0 3\n"
-        "-1 roll put 3 1 roll 0 0 1 5 -1 roll { 2 index exch get add 256 mul }\n"
-        "for 256 div exch pop exch { neg } if } def\n"
-        "/xcmd { rcmd exch rhex exch rhex exch 5 -1 roll add exch 4 -1 roll add\n"
-        "1 index 1 index 5 -1 roll { moveto } { lineto } ifelse } def end\n"
-        "/readpath { 0 0 pathdict begin { xcmd } loop end pop pop } def\n"
-        "\n"
-        "systemdict /languagelevel known not {\n"
-        "/xshow { exch dup length 0 1 3 -1 roll 1 sub { dup 3 index exch get\n"
-        "exch 2 index exch get 1 string dup 0 4 -1 roll put currentpoint 3 -1\n"
-        "roll show moveto 0 rmoveto } for pop pop } def\n"
-        "/rectangle { 4 -2 roll moveto 1 index 0 rlineto 0 exch rlineto neg 0\n"
-        "rlineto closepath } def\n"
-        "/rectfill { rectangle fill } def\n"
-        "/rectstroke { rectangle stroke } def } if\n"
-        "/bshow { currentlinewidth 3 1 roll currentpoint 3 index show moveto\n"
-        "setlinewidth false charpath stroke setlinewidth } def\n"
-        "/bxshow { currentlinewidth 4 1 roll setlinewidth exch dup length 1 sub\n"
-        "0 1 3 -1 roll { 1 string 2 index 2 index get 1 index exch 0 exch put dup\n"
-        "currentpoint 3 -1 roll show moveto currentpoint 3 -1 roll false charpath\n"
-        "stroke moveto 2 index exch get 0 rmoveto } for pop pop setlinewidth } def\n"
-        "\n"
-        "/psp_lzwfilter { currentfile /ASCII85Decode filter /LZWDecode filter } def\n"
-        "/psp_ascii85filter { currentfile /ASCII85Decode filter } def\n"
-        "/psp_lzwstring { psp_lzwfilter 1024 string readstring } def\n"
-        "/psp_ascii85string { psp_ascii85filter 1024 string readstring } def\n"
-        "/psp_imagedict {\n"
-        "/psp_bitspercomponent { 3 eq { 1 }{ 8 } ifelse } def\n"
-        "/psp_decodearray { [ [0 1 0 1 0 1] [0 255] [0 1] [0 255] ] exch get }\n"
-        "def 7 dict dup\n"
-        "/ImageType 1 put dup\n"
-        "/Width 7 -1 roll put dup\n"
-        "/Height 5 index put dup\n"
-        "/BitsPerComponent 4 index psp_bitspercomponent put dup\n"
-        "/Decode 5 -1 roll psp_decodearray put dup\n"
-        "/ImageMatrix [1 0 0 1 0 0] dup 5 8 -1 roll put put dup\n"
-        "/DataSource 4 -1 roll 1 eq { psp_lzwfilter } { psp_ascii85filter } ifelse put\n"
-        "} def\n"
-        "%%EndResource\n"
-        "%%EndProlog\n"
-    };
-    WritePS (pFile, m_pGraphics && m_pGraphics->getStrictSO52Compatibility() ? pSO52CompatProlog : pProlog);
+    WritePS (pFile, pProlog);
 
     return true;
 }
diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx
index d14d70c..06dbf7d 100644
--- a/vcl/generic/print/text_gfx.cxx
+++ b/vcl/generic/print/text_gfx.cxx
@@ -655,38 +655,7 @@ PrinterGfx::getCharMetric (const Font3 &rFont, sal_Unicode n_char, CharacterMetr
     {
         fontID n_font = rFont.GetFont(n);
         if (n_font != -1)
-        {
-            if( mbStrictSO52Compatibility )
-            {
-                fonttype::type eType = mrFontMgr.getFontType( n_font );
-                if( (eType == fonttype::Builtin || eType == fonttype::Type1) )
-                {
-                    // note: any character exchanged here MUST also be changed
-                    // in the compatibility ISO encoding vector in the prolog
-                    // in printerjob.cxx
-                    sal_Unicode aRepl = 0;
-                    if( n_char == 0x2d )
-                        aRepl = 0x2212;
-                    else if( n_char == 0x27 )
-                        aRepl = 0x2019;
-                    /*
-                    additional characters that may need backwards compatibility:
-                    ISO5589   StdEnc   Unicode    suggested n_char -> aRepl
-                    0264      0302     0x00B4     0x00B4 (acute) -> 0x2019 (quiteright)
-                    0246      -        0x00A6     0x00A6 (brokenbar) -> 0x007C (bar)
-                    0225      0267     0x0095     0x0095 () -> 0x2022 (bullet)
-                    0140      0301     0x0060     0x0060 (grave) -> ?
-                    */
-                    if( aRepl )
-                    {
-                        mrFontMgr.getMetrics( n_font, aRepl, aRepl, p_bbox );
-                        if (p_bbox->width >= 0 && p_bbox->height >= 0)
-                            return n_font;
-                    }
-                }
-            }
             mrFontMgr.getMetrics( n_font, n_char, n_char, p_bbox );
-        }
         if (p_bbox->width >= 0 && p_bbox->height >= 0)
             return n_font;
     }
@@ -853,15 +822,4 @@ PrinterGfx::writeResources( osl::File* pFile, std::list< rtl::OString >& rSuppli
         }
     }
 }
-
-bool PrinterGfx::getStrictSO52Compatibility() const
-{
-    return mbStrictSO52Compatibility;
-}
-
-void PrinterGfx::setStrictSO52Compatibility( bool bCompat)
-{
-    mbStrictSO52Compatibility = bCompat;
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index a567438..d50436a 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -192,17 +192,6 @@ SalInfoPrinter* SvpSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
         pJobSetup->maPrinterName    = pQueueInfo->maPrinterName;
         pJobSetup->maDriver         = aInfo.m_aDriverName;
         copyJobDataToJobSetup( pJobSetup, aInfo );
-
-        // set/clear backwards compatibility flag
-        bool bStrictSO52Compatibility = false;
-        boost::unordered_map<rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator compat_it =
-            pJobSetup->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "StrictSO52Compatibility" ) ) );
-        if( compat_it != pJobSetup->maValueMap.end() )
-        {
-            if( compat_it->second.equalsIgnoreAsciiCaseAsciiL(RTL_CONSTASCII_STRINGPARAM("true")) )
-                bStrictSO52Compatibility = true;
-        }
-        pPrinter->m_aPrinterGfx.setStrictSO52Compatibility( bStrictSO52Compatibility );
     }
 
 
diff --git a/vcl/inc/generic/printergfx.hxx b/vcl/inc/generic/printergfx.hxx
index a8d259a..3ac5df0 100644
--- a/vcl/inc/generic/printergfx.hxx
+++ b/vcl/inc/generic/printergfx.hxx
@@ -262,7 +262,6 @@ private:
     fontID          getFontSubstitute () const;
     fontID          getFallbackID () const { return mnFallbackID; }
 
-    bool            mbStrictSO52Compatibility;
 public:
     /* grahics status update */
     void            PSSetColor ();
@@ -433,8 +432,6 @@ public:
                                 sal_Int16 nLen,
                                 sal_Int32* pDeltaArray );
 
-    bool getStrictSO52Compatibility() const;
-    void setStrictSO52Compatibility( bool );
 };
 
 } /* namespace psp */
-- 
1.7.4.1


--------------050707000909090504090209--


More information about the LibreOffice mailing list