6a4f538
From 0709713ad7ee0fa26b2a4f12720834e47e5dd681 Mon Sep 17 00:00:00 2001
6a4f538
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
6a4f538
Date: Tue, 6 May 2014 15:56:23 +0100
6a4f538
Subject: [PATCH] Related: fdo#36815 clip overlarge comment contents
6a4f538
6a4f538
and add an indicator that the comment won't fit in the space available
6a4f538
6a4f538
Change-Id: I8dce7dfa678a606e8c4532addc4ba70c2a43644e
6a4f538
---
6a4f538
 sw/source/ui/docvw/SidebarTxtControl.cxx | 23 ++++-------------------
6a4f538
 sw/source/ui/docvw/SidebarWin.cxx        | 31 ++++++++++++++++++++++---------
6a4f538
 2 files changed, 26 insertions(+), 28 deletions(-)
6a4f538
6a4f538
diff --git a/sw/source/ui/docvw/SidebarTxtControl.cxx b/sw/source/ui/docvw/SidebarTxtControl.cxx
6a4f538
index 15af740..889c3bb 100644
6a4f538
--- a/sw/source/ui/docvw/SidebarTxtControl.cxx
6a4f538
+++ b/sw/source/ui/docvw/SidebarTxtControl.cxx
6a4f538
@@ -120,28 +120,13 @@ void SidebarTxtControl::RequestHelp(const HelpEvent &rEvt)
6a4f538
 
6a4f538
 void SidebarTxtControl::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, sal_uLong)
6a4f538
 {
6a4f538
-    if ( !Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
6a4f538
-    {
6a4f538
-        if ( mrSidebarWin.IsMouseOverSidebarWin() ||
6a4f538
-             HasFocus() )
6a4f538
-        {
6a4f538
-            pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ),
6a4f538
-                          Gradient( GradientStyle_LINEAR,
6a4f538
-                                    mrSidebarWin.ColorDark(),
6a4f538
-                                    mrSidebarWin.ColorDark() ) );
6a4f538
-        }
6a4f538
-        else
6a4f538
-        {
6a4f538
-            pDev->DrawGradient( Rectangle( Point(0,0) + rPt, PixelToLogic(GetSizePixel()) ),
6a4f538
-                          Gradient( GradientStyle_LINEAR,
6a4f538
-                                    mrSidebarWin.ColorLight(),
6a4f538
-                                    mrSidebarWin.ColorDark()));
6a4f538
-        }
6a4f538
-    }
6a4f538
+    //Take the control's height, but overwrite the scrollbar area if there was one
6a4f538
+    Size aSize(PixelToLogic(GetSizePixel()));
6a4f538
+    aSize.Width() = rSz.Width();
6a4f538
 
6a4f538
     if ( GetTextView() )
6a4f538
     {
6a4f538
-        GetTextView()->GetOutliner()->Draw(pDev, Rectangle(rPt, rSz));
6a4f538
+        GetTextView()->GetOutliner()->Draw(pDev, Rectangle(rPt, aSize));
6a4f538
     }
6a4f538
 
6a4f538
     if ( mrSidebarWin.GetLayoutStatus()==SwPostItHelper::DELETED )
6a4f538
diff --git a/sw/source/ui/docvw/SidebarWin.cxx b/sw/source/ui/docvw/SidebarWin.cxx
6a4f538
index c3aa5b0..ebc4d4c 100644
6a4f538
--- a/sw/source/ui/docvw/SidebarWin.cxx
6a4f538
+++ b/sw/source/ui/docvw/SidebarWin.cxx
6a4f538
@@ -218,15 +218,7 @@ void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, s
6a4f538
 {
6a4f538
     if (mpMetadataAuthor->IsVisible() )
6a4f538
     {
6a4f538
-        //draw left over space
6a4f538
-        if ( Application::GetSettings().GetStyleSettings().GetHighContrastMode() )
6a4f538
-        {
6a4f538
-            pDev->SetFillColor(COL_BLACK);
6a4f538
-        }
6a4f538
-        else
6a4f538
-        {
6a4f538
-            pDev->SetFillColor(mColorDark);
6a4f538
-        }
6a4f538
+        pDev->SetFillColor(mColorDark);
6a4f538
         pDev->SetLineColor();
6a4f538
         pDev->DrawRect( Rectangle( rPt, rSz ) );
6a4f538
     }
6a4f538
@@ -265,6 +257,27 @@ void SwSidebarWin::Draw(OutputDevice* pDev, const Point& rPt, const Size& rSz, s
6a4f538
 
6a4f538
     pProcessor->process(rSequence);
6a4f538
     delete pProcessor;
6a4f538
+
6a4f538
+    if (mpVScrollbar->IsVisible())
6a4f538
+    {
6a4f538
+        Font aOrigFont(mpMetadataDate->GetControlFont());
6a4f538
+        Color aOrigBg( mpMetadataDate->GetControlBackground() );
6a4f538
+        OUString sOrigText(mpMetadataDate->GetText());
6a4f538
+
6a4f538
+        Size aSize(PixelToLogic(mpMenuButton->GetSizePixel()));
6a4f538
+        Point aPos(PixelToLogic(mpMenuButton->GetPosPixel()));
6a4f538
+        aPos += rPt;
6a4f538
+
6a4f538
+        Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
6a4f538
+        mpMetadataDate->SetControlFont( aFont );
6a4f538
+        mpMetadataDate->SetControlBackground( 0xFFFFFF );
6a4f538
+        mpMetadataDate->SetText("...");
6a4f538
+        mpMetadataDate->Draw(pDev, aPos, aSize, nInFlags);
6a4f538
+
6a4f538
+        mpMetadataDate->SetText(sOrigText);
6a4f538
+        mpMetadataDate->SetControlFont( aOrigFont );
6a4f538
+        mpMetadataDate->SetControlBackground( aOrigBg );
6a4f538
+    }
6a4f538
 }
6a4f538
 
6a4f538
 void SwSidebarWin::SetPosSizePixelRect( long nX,
6a4f538
-- 
6a4f538
1.9.0
6a4f538