[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-4.3' - 2 commits - sw/source vcl/unx

Luboš Luňák l.lunak at collabora.com
Tue Feb 24 13:40:05 PST 2015


 sw/source/filter/ww1/fltshell.cxx |    2 +-
 sw/source/filter/ww8/ww8par5.cxx  |   25 +++++++++----------------
 vcl/unx/generic/app/saldisp.cxx   |    9 +--------
 3 files changed, 11 insertions(+), 25 deletions(-)

New commits:
commit b0760a5732b70c42bfdc370a7a019403c2643a8d
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Tue Feb 24 15:56:42 2015 +0100

    dump ugly hack working around an ancient libxcb bug (tdf#89141)
    
    According to the X protocol log in the bugreport, this timed function
    sometimes does time out, in which case the timestamp becomes 0, which
    as user timestamp is interpreted by window managers as "do not focus",
    which is indeed stupid to ask for just because a call timed out.
    Especially given that this is broken in principle, as the event is
    bound to come (barring the more than 5 years old libxcb bug, which
    must have been such a lame bug that it probably shouldn't even have
    been worked around, and definitely not unconditionally and permanently).
    
    Change-Id: I4d122ea038c0c56b1fda590df13bf119d746fd0a

diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index 73c7b1f..96cbfa1 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -2309,14 +2309,7 @@ XLIB_Time SalDisplay::GetLastUserEventTime( bool i_bAlwaysReget ) const
         Atom nAtom = getWMAdaptor()->getAtom( WMAdaptor::SAL_GETTIMEEVENT );
         XChangeProperty( GetDisplay(), GetDrawable( GetDefaultXScreen() ),
                          nAtom, nAtom, 8, PropModeReplace, &c, 1 );
-        XFlush( GetDisplay() );
-
-        if( ! XIfEventWithTimeout( &aEvent, (XPointer)this, timestamp_predicate ) )
-        {
-            // this should not happen at all; still sometimes it happens
-            aEvent.xproperty.time = CurrentTime;
-        }
-
+        XIfEvent( GetDisplay(), &aEvent, timestamp_predicate, reinterpret_cast<XPointer>(const_cast<SalDisplay *>(this)));
         m_nLastUserEventTime = aEvent.xproperty.time;
     }
     return m_nLastUserEventTime;
commit 6e9d351bae650e8fbf7f397a6bc6747c731e291b
Author: Andras Timar <andras.timar at collabora.com>
Date:   Tue Feb 24 22:26:42 2015 +0100

    Revert "fdo#68963 recognize __RefHeading__ bookmarks as TOC"
    
    This reverts commit 2fd7f3ab66a5dca2adbe491b8f471470229ebe94.

diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 330b2a0..6fd4c3d 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -948,7 +948,7 @@ SwFltBookmark::SwFltBookmark( const OUString& rNa, const OUString& rVa,
     // otherwise: Src Charset from argument for aName
     // Src Charset from filter for aVal ( Text )
 
-    if ( IsTOCBookmark() && ! rNa.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
+    if ( IsTOCBookmark() )
     {
         maName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
         maName += rNa;
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index a2b93e1..cac63fd 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -101,18 +101,7 @@ namespace
     // #120879# - helper method to identify a bookmark name to match the internal TOC bookmark naming convention
     bool IsTOCBookmarkName( const ::rtl::OUString& rName )
     {
-        return rName.startsWith("_Toc") || rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix());
-    }
-
-    ::rtl::OUString EnsureTOCBookmarkName( const ::rtl::OUString& rName )
-    {
-        OUString sTmp = rName;
-        if ( IsTOCBookmarkName ( rName ) )
-        {
-            if ( ! rName.startsWith(IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix()) )
-                sTmp = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix() + rName;
-        }
-        return sTmp;
+        return rName.startsWith("_Toc");
     }
 }
 
@@ -226,7 +215,7 @@ long SwWW8ImplReader::Read_Book(WW8PLCFManResult*)
 
     const OUString sOrigName = BookmarkToWriter(*pName);
     pReffedStck->NewAttr( aStart,
-                          SwFltBookmark( EnsureTOCBookmarkName( sOrigName ), aVal, pB->GetHandle(), IsTOCBookmarkName( sOrigName ) ));
+                          SwFltBookmark( sOrigName, aVal, pB->GetHandle(), IsTOCBookmarkName( sOrigName ) ));
     return 0;
 }
 
@@ -2076,7 +2065,8 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
             OUString sBookmarkName;
             if ( IsTOCBookmarkName( sName ) )
             {
-                sBookmarkName = EnsureTOCBookmarkName(sName);
+                sBookmarkName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
+                sBookmarkName += sName;
                 // track <sBookmarkName> as referenced TOC bookmark.
                 pReffedStck->aReferencedTOCBookmarks.insert( sBookmarkName );
             }
@@ -2102,7 +2092,8 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
     OUString sPageRefBookmarkName;
     if ( IsTOCBookmarkName( sName ) )
     {
-        sPageRefBookmarkName = EnsureTOCBookmarkName(sName);
+        sPageRefBookmarkName = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
+        sPageRefBookmarkName += sName;
         // track <sPageRefBookmarkName> as referenced TOC bookmark.
         pReffedStck->aReferencedTOCBookmarks.insert( sPageRefBookmarkName );
     }
@@ -3425,7 +3416,9 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
                         // #120879# add cross reference bookmark name prefix, if it matches internal TOC bookmark naming convention
                         if ( IsTOCBookmarkName( sMark ) )
                         {
-                            sMark = EnsureTOCBookmarkName(sMark);
+                            OUString sTmp = IDocumentMarkAccess::GetCrossRefHeadingBookmarkNamePrefix();
+                            sTmp += sMark;
+                            sMark = sTmp;
                             // track <sMark> as referenced TOC bookmark.
                             pReffedStck->aReferencedTOCBookmarks.insert( sMark );
                         }


More information about the Libreoffice-commits mailing list