rpms/openoffice.org/devel openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch, 1.3, 1.4 openoffice.org.spec, 1.862, 1.863

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Mon Aug 28 10:25:33 UTC 2006


Author: caolanm

Update of /cvs/dist/rpms/openoffice.org/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv1497

Modified Files:
	openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch 
	openoffice.org.spec 
Log Message:
rh#204173# rh#203063# fix crash, and better handle glyph replacement

openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch:
 inc/outdev.h             |    3 +--
 inc/sallayout.hxx        |    1 +
 source/gdi/outdev3.cxx   |   44 +++++++++++++++++++++++++-------------------
 source/gdi/sallayout.cxx |   46 ++++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 71 insertions(+), 23 deletions(-)

Index: openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch	24 Aug 2006 12:18:01 -0000	1.3
+++ openoffice.org-1.9.129.ooo54603.fontconfig.part3.patch	28 Aug 2006 10:25:30 -0000	1.4
@@ -1,6 +1,6 @@
-diff -ru vcl.orig/inc/outdev.h vcl/inc/outdev.h
---- openoffice.org.orig/vcl/inc/outdev.h	2006-08-23 10:05:16.000000000 +0100
-+++ openoffice.org/vcl/inc/outdev.h	2006-08-23 10:13:54.000000000 +0100
+diff -ru vcl/inc/outdev.h vcl/inc/outdev.h
+--- openoffice.org.orig/vcl/inc/outdev.h	2006-08-28 10:10:31.000000000 +0100
++++ openoffice.org/vcl/inc/outdev.h	2006-08-28 10:12:31.000000000 +0100
 @@ -213,8 +213,7 @@
                               const Font& rFont, const Size& rSize, ImplFontSubstEntry* pDevSpecific );
      ImplFontEntry*      GetFallback( ImplDevFontList* pFontList,
@@ -11,9 +11,20 @@
      void                Release( ImplFontEntry* );
      void                Invalidate();
  };
-diff -ru vcl.orig/source/gdi/outdev3.cxx vcl/source/gdi/outdev3.cxx
---- openoffice.org.orig/vcl/source/gdi/outdev3.cxx	2006-08-23 10:05:02.000000000 +0100
-+++ openoffice.org/vcl/source/gdi/outdev3.cxx	2006-08-23 10:28:30.000000000 +0100
+diff -ru vcl/inc/sallayout.hxx vcl/inc/sallayout.hxx
+--- openoffice.org.orig/vcl/inc/sallayout.hxx	2006-08-28 10:10:31.000000000 +0100
++++ openoffice.org/vcl/inc/sallayout.hxx	2006-08-28 10:24:05.000000000 +0100
+@@ -101,6 +101,7 @@
+     bool    GetRun( int* nMinRunPos, int* nEndRunPos, bool* bRTL ) const;
+     bool    GetNextPos( int* nCharPos, bool* bRTL );
+     bool    PosIsInRun( int nCharPos ) const;
++    bool    PosIsInAnyRun( int nCharPos ) const;
+ };
+ 
+ // -----------------
+diff -ru vcl/source/gdi/outdev3.cxx vcl/source/gdi/outdev3.cxx
+--- openoffice.org.orig/vcl/source/gdi/outdev3.cxx	2006-08-28 10:10:31.000000000 +0100
++++ openoffice.org/vcl/source/gdi/outdev3.cxx	2006-08-28 10:23:36.000000000 +0100
 @@ -3128,7 +3128,7 @@
  
  ImplFontEntry* ImplFontCache::GetFallback( ImplDevFontList* pFontList,
@@ -41,61 +52,63 @@
          if ( aSelData.maSearchName.Len() )
              cached = true;
      }
-@@ -3180,10 +3178,24 @@
+@@ -3180,10 +3178,26 @@
      if ( !cached )
      {
          String aName(GetFcSubstitute( aSelData, aGlyphs ));
 -      if (aName.Len())
--            aSelData.maSearchName = aName;
-+		if (aName.Len())
-+			aSelData.maSearchName = aName;
++        if (aName.Len())
+             aSelData.maSearchName = aName;
      }
  
-+	if (!rMissingGlyphs.empty())
-+	{
++    if (!rMissingGlyphs.empty())
++    {
 +        std::vector<sal_Unicode>::const_iterator aEnd = aGlyphs.end();
 +        for (std::vector<sal_Unicode>::const_iterator aI = aGlyphs.begin(); aI != aEnd; ++aI)
-+		{
-+            rMissingGlyphs.erase(std::remove(rMissingGlyphs.begin(), rMissingGlyphs.end(), *aI));
-+
-+			//In this case only the first missing symbol has been taken into account, and is 
-+			//known safe to replace
-+			if (cached || symbolFont)
-+				break;
-+		}
-+	}
++        {
++            std::vector<sal_Unicode>::iterator aNewEnd = 
++                std::remove(rMissingGlyphs.begin(), rMissingGlyphs.end(), *aI);
++            if (aNewEnd != rMissingGlyphs.end())
++                rMissingGlyphs.erase(aNewEnd);
++            //In this case only the first missing symbol has been taken into account and is
++            //known safe to replace
++            if (cached || symbolFont)
++                break;
++        }
++    }
 +
      // Check our font instance cache first, if not found then
      // add this ImplFontSelectData to the cache along with its ImplFontEntry
      FontInstanceList::const_iterator it = maFontInstanceList.find( aSelData );
-@@ -6257,14 +6269,9 @@
+@@ -6257,14 +6271,9 @@
  #endif
      int nCharPos = -1;
      bool bRTL = false;
 -    sal_Unicode *pMissingUnicodes = new sal_Unicode[8];
 -    int nMissingUnicodes = 0;
 -
-+    std::vector<sal_Unicode> aGlyphs;
-     for( int i=0; i<8 && rLayoutArgs.GetNextPos( &nCharPos, &bRTL); ++i )
+-    for( int i=0; i<8 && rLayoutArgs.GetNextPos( &nCharPos, &bRTL); ++i )
 -    {
 -        pMissingUnicodes[i] = rLayoutArgs.mpStr[ nCharPos ];
 -        nMissingUnicodes++;
 -    }
++    std::vector<sal_Unicode> aGlyphs;
++    while (rLayoutArgs.GetNextPos( &nCharPos, &bRTL))
 +        aGlyphs.push_back(rLayoutArgs.mpStr[ nCharPos ]);
      rLayoutArgs.ResetPos();
  
      ImplFontSelectData aFontSelData = mpFontEntry->maFontSelData;
-@@ -6282,8 +6289,7 @@
+@@ -6282,8 +6291,7 @@
      {
          // find a font family suited for glyph fallback
          ImplFontEntry* pFallbackFont = mpFontCache->GetFallback( mpFontList,
 -            maFont, aFontSize, nFallbackLevel-nDevSpecificFallback,
 -            (nMissingUnicodes ? pMissingUnicodes : NULL), nMissingUnicodes );
-+            maFont, aFontSize, nFallbackLevel-nDevSpecificFallback, aGlyphs);
++            maFont, aFontSize, nFallbackLevel-nDevSpecificFallback, aGlyphs );
          if( !pFallbackFont )
              break;
  
-@@ -6335,8 +6341,6 @@
+@@ -6335,8 +6343,6 @@
              break;
      }
  
@@ -104,15 +117,87 @@
      if( pMultiSalLayout && pMultiSalLayout->LayoutText( rLayoutArgs ) )
          pSalLayout = pMultiSalLayout;
  
-diff -ru vcl.orig/source/gdi/sallayout.cxx vcl/source/gdi/sallayout.cxx
---- openoffice.org.orig/vcl/source/gdi/sallayout.cxx	2006-08-23 10:05:02.000000000 +0100
-+++ openoffice.org/vcl/source/gdi/sallayout.cxx	2006-08-23 10:06:12.000000000 +0100
-@@ -1712,7 +1715,7 @@
+diff -ru vcl/source/gdi/sallayout.cxx vcl/source/gdi/sallayout.cxx
+--- openoffice.org.orig/vcl/source/gdi/sallayout.cxx	2006-08-28 10:10:31.000000000 +0100
++++ openoffice.org/vcl/source/gdi/sallayout.cxx	2006-08-28 10:36:03.000000000 +0100
+@@ -455,6 +455,27 @@
+     return true;
+ }
+ 
++bool ImplLayoutRuns::PosIsInAnyRun( int nCharPos ) const
++{
++    bool bRet = false;
++    int nRunIndex = mnRunIndex;
++
++    ImplLayoutRuns *pThis = const_cast<ImplLayoutRuns*>(this);
++
++    pThis->ResetPos();
++
++    for (int i = 0; i < maRuns.size(); i+=2)
++    {
++        if ((bRet = PosIsInRun( nCharPos )))
++            break;
++        pThis->NextRun();
++    }
++
++    pThis->mnRunIndex = nRunIndex;
++    return bRet;
++}
++
++
+ // -----------------------------------------------------------------------
+ 
+ bool ImplLayoutRuns::GetNextPos( int* nCharPos, bool* bRightToLeft )
+@@ -1693,7 +1714,7 @@
+     {
+         // find best fallback level
+         for( n = 0; n < nLevel; ++n )
+-            if( nValid[n] && !maFallbackRuns[n].PosIsInRun( nActiveCharPos ) )
++            if( nValid[n] && !maFallbackRuns[n].PosIsInAnyRun( nActiveCharPos ) )
+                 // fallback level n wins when it requested no further fallback
+                 break;
+         int nFBLevel = n;
+@@ -1715,7 +1736,10 @@
          if( n > 0 )
          {
              // drop the NotDef glyphs in the base layout run if a fallback run exists
 -            while( maFallbackRuns[ n-1 ].PosIsInRun( nCharPos[0] ) )
-+            while (( maFallbackRuns[ n-1 ].PosIsInRun( nCharPos[0] ) ) && ( !maFallbackRuns[ n ].PosIsInRun( nCharPos[0] ) ))
++            while ( 
++                    (maFallbackRuns[ n-1 ].PosIsInRun( nCharPos[0] ) ) &&
++                    (!maFallbackRuns[ n ].PosIsInAnyRun( nCharPos[0] ) )
++                  )
              {
                  mpLayouts[0]->DropGlyph( nStartOld[0] );
                  nStartOld[0] = nStartNew[0];
+@@ -1735,6 +1759,7 @@
+ 
+             // proceed to next glyph
+             nStartOld[n] = nStartNew[n];
++            int nOrigCharPos = nCharPos[n];
+             nValid[n] = mpLayouts[n]->GetNextGlyphs( 1, &nDummy, aPos,
+                 nStartNew[n], &nGlyphAdv[n], &nCharPos[n] );
+ 
+@@ -1747,6 +1772,23 @@
+                 break;
+             }
+ 
++            //If the next character is one which belongs to the next level, then we
++            //are finished here for now, and we'll pick up after the next level has
++            //been processed
++            if ((n+1 < nLevel) && (std::abs(nCharPos[n] - nOrigCharPos)))
++            {
++                if (nOrigCharPos < nCharPos[n])
++                {
++                    if (nCharPos[n+1] > nOrigCharPos && (nCharPos[n+1] < nCharPos[n]))
++                        break;
++                }
++                else if (nOrigCharPos < nCharPos[n])
++                {
++                    if (nCharPos[n+1] > nCharPos[n] && (nCharPos[n+1] < nOrigCharPos))
++                        break;
++                }
++            }
++
+             // break at end of layout run
+             if( n > 0 )
+             {


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/dist/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.862
retrieving revision 1.863
diff -u -r1.862 -r1.863
--- openoffice.org.spec	25 Aug 2006 10:26:14 -0000	1.862
+++ openoffice.org.spec	28 Aug 2006 10:25:30 -0000	1.863
@@ -2508,6 +2508,11 @@
 %{instdir}/share/registry/modules/org/openoffice/Office/Scripting/Scripting-python.xcu
 
 %changelog
+* Mon Aug 28 2006 Caolan McNamara <caolanm at redhat.com> - 1:2.0.4-2.2
+- rh#203063# Glyph replacement work when single run has multiple fonts
+- rh#204173# Crash on Glyph replacement when single run has single glyph
+  for multiple character positions
+
 * Fri Aug 25 2006 Caolan McNamara <caolanm at redhat.com> - 1:2.0.4-2.1
 - fix openoffice.org-2.0.4.ooo68369.dtrans.crash.patch
 - fix openoffice.org-2.0.4.ooo68805.sw.ww8size.patch




More information about the fedora-cvs-commits mailing list