[Libreoffice-commits] .: Branch 'libreoffice-3-5' - 2 commits - sw/source writerfilter/source

Cédric Bosdonnat cbosdo at kemper.freedesktop.org
Fri Jan 20 07:04:29 PST 2012


 sw/source/ui/docvw/PageBreakWin.cxx            |   22 ++++++++++++++++------
 writerfilter/source/rtftok/rtfdocumentimpl.cxx |   19 ++++++++++++++++---
 2 files changed, 32 insertions(+), 9 deletions(-)

New commits:
commit 23ac66dd14d09acc07868ee75da05073c6a78f44
Author: Miklos Vajna <vmiklos at frugalware.org>
Date:   Fri Jan 20 01:36:25 2012 +0100

    Fix RTF import of dotted and word underline
    
    The problem was that these are flags, not toggles.
    
    Signed-off-by: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>

diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 82b2a31..62445de 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1455,6 +1455,21 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
     checkUnicode();
     RTFSkipDestination aSkip(*this);
     int nParam = -1;
+    int nSprm = -1;
+
+    // Map all underline flags to a single sprm.
+    switch (nKeyword)
+    {
+        case RTF_ULD: nSprm = 4; break;
+        case RTF_ULW: nSprm = 2; break;
+        default: break;
+    }
+    if (nSprm >= 0)
+    {
+        RTFValue::Pointer_t pValue(new RTFValue(nSprm));
+        m_aStates.top().aCharacterSprms->push_back(make_pair(NS_sprm::LN_CKul, pValue));
+        return 0;
+    }
 
     // Indentation
     switch (nKeyword)
@@ -2558,11 +2573,10 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
     int nSprm = -1;
     RTFValue::Pointer_t pBoolValue(new RTFValue(!bParam || nParam != 0));
 
-    // Map all underline keywords to a single sprm.
+    // Map all underline toggles to a single sprm.
     switch (nKeyword)
     {
         case RTF_UL: nSprm = 1; break;
-        case RTF_ULD: nSprm = 4; break;
         case RTF_ULDASH: nSprm = 7; break;
         case RTF_ULDASHD: nSprm = 9; break;
         case RTF_ULDASHDD: nSprm = 10; break;
@@ -2576,7 +2590,6 @@ int RTFDocumentImpl::dispatchToggle(RTFKeyword nKeyword, bool bParam, int nParam
         case RTF_ULTHDASHDD: nSprm = 26; break;
         case RTF_ULTHLDASH: nSprm = 55; break;
         case RTF_ULULDBWAVE: nSprm = 43; break;
-        case RTF_ULW: nSprm = 2; break;
         case RTF_ULWAVE: nSprm = 11; break;
         default: break;
     }
commit 0c8c85ec6ec3a19f86df844b59b2f540d8972186
Author: Cédric Bosdonnat <cedric.bosdonnat.ooo at free.fr>
Date:   Fri Jan 20 15:40:02 2012 +0100

    Revert "Page Breaks: IsLeaveWindow() is unreliable, we do not need it here."
    
    This reverts commit 1e0de54d88a79c99f0671f608f7de096cb721537. This
    commit introduces the button flickering behavior.

diff --git a/sw/source/ui/docvw/PageBreakWin.cxx b/sw/source/ui/docvw/PageBreakWin.cxx
index ff5050b..0edeb61 100644
--- a/sw/source/ui/docvw/PageBreakWin.cxx
+++ b/sw/source/ui/docvw/PageBreakWin.cxx
@@ -83,11 +83,17 @@ namespace
 
     void SwBreakDashedLine::MouseMove( const MouseEvent& rMEvt )
     {
-        Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
-        if ( !m_pWin->Contains( aEventPos ) )
-            m_pWin->Fade( false );
+        if ( rMEvt.IsLeaveWindow() )
+        {
+            // don't fade if we just move to the 'button'
+            Point aEventPos( GetPosPixel() + rMEvt.GetPosPixel() );
+            if ( !m_pWin->Contains( aEventPos ) )
+                m_pWin->Fade( false );
+        }
         else if ( !m_pWin->IsVisible() )
+        {
             m_pWin->Fade( true );
+        }
 
         if ( !rMEvt.IsSynthetic() )
         {
@@ -303,9 +309,13 @@ void SwPageBreakWin::Select( )
 
 void SwPageBreakWin::MouseMove( const MouseEvent& rMEvt )
 {
-    Point aEventPos( rMEvt.GetPosPixel() + rMEvt.GetPosPixel() );
-    if ( !Contains( aEventPos ) && !PopupMenu::IsInExecute() )
-        Fade( false );
+    if ( rMEvt.IsLeaveWindow() )
+    {
+        // don't fade if we just move to the 'line', or the popup menu is open
+        Point aEventPos( rMEvt.GetPosPixel() + rMEvt.GetPosPixel() );
+        if ( !Contains( aEventPos ) && !PopupMenu::IsInExecute() )
+            Fade( false );
+    }
     else if ( !IsVisible() )
         Fade( true );
 }


More information about the Libreoffice-commits mailing list