[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Tue May 6 07:57:43 PDT 2014


 sw/source/core/uibase/docvw/SidebarTxtControl.cxx |   23 ++--------------
 sw/source/core/uibase/docvw/SidebarWin.cxx        |   31 +++++++++++++++-------
 2 files changed, 26 insertions(+), 28 deletions(-)

New commits:
commit bb2d5c40e48d899bc39a18e6e038e067f6b9418b
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue May 6 15:56:23 2014 +0100

    Related: fdo#36815 clip overlarge comment contents
    
    and add an indicator that the comment won't fit in the space available
    
    Change-Id: I8dce7dfa678a606e8c4532addc4ba70c2a43644e

diff --git a/sw/source/core/uibase/docvw/SidebarTxtControl.cxx b/sw/source/core/uibase/docvw/SidebarTxtControl.cxx
index 4e84a0b..5834c02 100644
--- a/sw/source/core/uibase/docvw/SidebarTxtControl.cxx
+++ b/sw/source/core/uibase/docvw/SidebarTxtControl.cxx
@@ -121,28 +121,13 @@ void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt)
 
 void SidebarTxtControl::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, sal_uLong)
 {
-    if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
-    {
-        if ( mrSidebarWin.IsMouseOverSidebarWin() ||
-             HasFocus() )
-        {
-            pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ),
-                          Gradient( GradientStyle_LINEAR,
-                                    mrSidebarWin.ColorDark(),
-                                    mrSidebarWin.ColorDark() ) );
-        }
-        else
-        {
-            pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ),
-                          Gradient( GradientStyle_LINEAR,
-                                    mrSidebarWin.ColorLight(),
-                                    mrSidebarWin.ColorDark()));
-        }
-    }
+    //Take the control's height, but overwrite the scrollbar area if there was one
+    Size aSize(PixelToLogic(GetSizePixel()));
+    aSize.Width() = rSz.Width();
 
     if ( GetTextView() )
     {
-        GetTextView()->GetOutliner()->Draw(pDev, Rectangle(rPt, rSz));
+        GetTextView()->GetOutliner()->Draw(pDev, Rectangle(rPt, aSize));
     }
 
     if ( mrSidebarWin.GetLayoutStatus()==SwPostItHelper::DELETED )
diff --git a/sw/source/core/uibase/docvw/SidebarWin.cxx b/sw/source/core/uibase/docvw/SidebarWin.cxx
index 1a7b6e6..34aaa23 100644
--- a/sw/source/core/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/core/uibase/docvw/SidebarWin.cxx
@@ -230,15 +230,7 @@ void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, s
 {
     if (mpMetadataAuthor->IsVisible() )
     {
-        //draw left over space
-        if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
-        {
-            pDev->SetFillColor(COL_BLACK);
-        }
-        else
-        {
-            pDev->SetFillColor(mColorDark);
-        }
+        pDev->SetFillColor(mColorDark);
         pDev->SetLineColor();
         pDev->DrawRect( Rectangle( rPt, rSz ) );
     }
@@ -279,6 +271,27 @@ void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, s
     if (mpTextRangeOverlay)
         pProcessor->process(mpTextRangeOverlay->getOverlayObjectPrimitive2DSequence());
     delete pProcessor;
+
+    if (mpVScrollbar->IsVisible())
+    {
+        Font aOrigFont(mpMetadataDate->GetControlFont());
+        Color aOrigBg( mpMetadataDate->GetControlBackground() );
+        OUString sOrigText(mpMetadataDate->GetText());
+
+        Size aSize(PixelToLogic(mpMenuButton->GetSizePixel()));
+        Point aPos(PixelToLogic(mpMenuButton->GetPosPixel()));
+        aPos += rPt;
+
+        Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
+        mpMetadataDate->SetControlFont( aFont );
+        mpMetadataDate->SetControlBackground( 0xFFFFFF );
+        mpMetadataDate->SetText("...");
+        mpMetadataDate->Draw(pDev, aPos, aSize, nInFlags);
+
+        mpMetadataDate->SetText(sOrigText);
+        mpMetadataDate->SetControlFont( aOrigFont );
+        mpMetadataDate->SetControlBackground( aOrigBg );
+    }
 }
 
 void SwSidebarWin::SetPosSizePixelRect( long nX,


More information about the Libreoffice-commits mailing list