summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-10 13:14:18 +0000
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2020-12-11 03:18:11 +0100
commit2e6ecdfec95ac18a197cf31a67455cd103b73198 (patch)
tree1bad4378ef6dccab3af6dc76680d8d9b30e68acc
parentleaked_storage (diff)
downloadcore-2e6ecdfec95ac18a197cf31a67455cd103b73198.tar.gz
core-2e6ecdfec95ac18a197cf31a67455cd103b73198.zip
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/+/107534 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
-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 9c3539f2e6d7..04c1f8332695 100644
--- a/sw/source/uibase/docvw/AnnotationWin2.cxx
+++ b/sw/source/uibase/docvw/AnnotationWin2.cxx
@@ -260,7 +260,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() )
{
@@ -287,6 +287,7 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
aPos += rPt;
vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
mpMetadataDate->SetControlFont( aFont );
+ mpMetadataDate->Draw(pDev, aPos, nInFlags);
mpMetadataDate->SetControlFont( aOrigFont );
}
@@ -297,13 +298,11 @@ void SwAnnotationWin::Draw(OutputDevice* pDev, const Point& rPt, DrawFlags nInFl
aPos += rPt;
vcl::Font aFont( mpMetadataResolved->GetSettings().GetStyleSettings().GetFieldFont() );
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(
@@ -319,6 +318,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());
@@ -330,7 +331,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);