Blame SOURCES/0001-Related-fdo-36815-clip-overlarge-comment-contents.patch

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