From bb2d5c40e48d899bc39a18e6e038e067f6b9418b Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 6 May 2014 15:56:23 +0100 Subject: Related: fdo#36815 clip overlarge comment contents and add an indicator that the comment won't fit in the space available Change-Id: I8dce7dfa678a606e8c4532addc4ba70c2a43644e --- sw/source/core/uibase/docvw/SidebarTxtControl.cxx | 23 +++-------------- sw/source/core/uibase/docvw/SidebarWin.cxx | 31 ++++++++++++++++------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/sw/source/core/uibase/docvw/SidebarTxtControl.cxx b/sw/source/core/uibase/docvw/SidebarTxtControl.cxx index 4e84a0be9333..5834c020832a 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 1a7b6e67d5d2..34aaa23243c7 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, -- cgit v1.2.3