summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-06 15:56:23 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-05-06 15:57:15 +0100
commitbb2d5c40e48d899bc39a18e6e038e067f6b9418b (patch)
tree04e6552ee8be6636a127585d1739e56931510db0
parent222489744cab5604313c086b05e57fba895ec4a6 (diff)
Related: fdo#36815 clip overlarge comment contents
and add an indicator that the comment won't fit in the space available Change-Id: I8dce7dfa678a606e8c4532addc4ba70c2a43644e
-rw-r--r--sw/source/core/uibase/docvw/SidebarTxtControl.cxx23
-rw-r--r--sw/source/core/uibase/docvw/SidebarWin.cxx31
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,