summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-10 13:14:18 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-12-10 17:11:38 +0100
commit47a5000822588b695f514866fd8cca48fb2d1ac3 (patch)
tree2d4767cb5f858df7dedd742871a3d0e0645bcdc6 /sw
parent328988babda60300fd854a116ceca742a4bd79ca (diff)
fix printing of 'margins in comment'
mangled since... commit c200aa27ee4a0f5a89af6e970c2c22580029eded Author: Caolán McNamara <caolanm@redhat.com> Date: Thu May 21 15:54:15 2020 +0100 remove Size arg from Window::Draw and depend on GetSizePixel which was a real monday-morning commit that bizarrely dropped drawing of the date/resolved widgets entirely and failed to notice that the PixelToLogic call in SwPostItMgr::DrawNotesForPage was originally called on the input pPostIt, not the output pDev Change-Id: I73b87f5889ef13018bcc43f97cd65169a3b77a65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107493 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/docvw/AnnotationWin2.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx
index 4b1e7c70836c..4e17e799e46d 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -273,7 +273,7 @@ void SwAnnotationWin::SetCursorLogicPosition(const Point& rPosition, bool bPoint
void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFlags)
{
- Size aSz = pDev->PixelToLogic(GetSizePixel());
+ Size aSz = PixelToLogic(GetSizePixel());
if (mpMetadataAuthor->IsVisible() )
{
@@ -300,6 +300,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
aPos += rPt;
vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetLabelFont() );
mpMetadataDate->SetControlFont( aFont );
+ mpMetadataDate->Draw(pDev, aPos, nInFlags);
mpMetadataDate->SetControlFont( aOrigFont );
}
@@ -310,13 +311,11 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
aPos += rPt;
vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetLabelFont() );
mpMetadataResolved->SetControlFont( aFont );
+ mpMetadataResolved->Draw(pDev, aPos, nInFlags);
mpMetadataResolved->SetControlFont( aOrigFont );
}
- Size aOrigSize(mpSidebarTextControl->GetSizePixel());
- mpSidebarTextControl->SetSizePixel(aSz);
mpSidebarTextControl->Draw(pDev, rPt, nInFlags);
- mpSidebarTextControl->SetSizePixel(aOrigSize);
const drawinglayer::geometry::ViewInformation2D aNewViewInfos;
std::unique_ptr<drawinglayer::processor2d::BaseProcessor2D> pProcessor(
@@ -332,6 +331,8 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
if (!mpVScrollbar->IsVisible())
return;
+ // if there is a scrollbar shown, draw "..." to indicate the comment isn't
+ // completely shown
vcl::Font aOrigFont(mpMetadataDate->GetControlFont());
Color aOrigBg( mpMetadataDate->GetControlBackground() );
OUString sOrigText(mpMetadataDate->GetText());
@@ -343,7 +344,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
mpMetadataDate->SetControlFont( aFont );
mpMetadataDate->SetControlBackground( Color(0xFFFFFF) );
mpMetadataDate->SetText("...");
- aOrigSize = mpMetadataDate->GetSizePixel();
+ Size aOrigSize = mpMetadataDate->GetSizePixel();
mpMetadataDate->SetSizePixel(mpMenuButton->GetSizePixel());
mpMetadataDate->Draw(pDev, aPos, nInFlags);
mpMetadataDate->SetSizePixel(aOrigSize);