[Libreoffice-commits] core.git: 2 commits - sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Nov 17 08:41:01 PST 2015
sw/source/uibase/docvw/PostItMgr.cxx | 2 +-
sw/source/uibase/docvw/SidebarWin.cxx | 12 +++++++-----
2 files changed, 8 insertions(+), 6 deletions(-)
New commits:
commit 6d00110674452c66ca6192fbf46b41331b2c7066
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Nov 17 17:14:58 2015 +0100
sw lok comments: fix meta author/data size with custom zoom
Change-Id: I3310813c971aa7abffccc0b7f462e05caa83482e
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 145033d..ba81a3e 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -668,11 +668,12 @@ void SwSidebarWin::Rescale()
mpOutliner->SetRefMapMode( aMode );
SetMapMode( aMode );
mpSidebarTextControl->SetMapMode( aMode );
+ const Fraction& rFraction = mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY();
if ( mpMetadataAuthor )
{
vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetFieldFont() );
sal_Int32 nHeight = aFont.GetHeight();
- nHeight = nHeight * aMode.GetScaleY().GetNumerator() / aMode.GetScaleY().GetDenominator();
+ nHeight = nHeight * rFraction.GetNumerator() / rFraction.GetDenominator();
aFont.SetHeight( nHeight );
mpMetadataAuthor->SetControlFont( aFont );
}
@@ -680,7 +681,7 @@ void SwSidebarWin::Rescale()
{
vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() );
sal_Int32 nHeight = aFont.GetHeight();
- nHeight = nHeight * aMode.GetScaleY().GetNumerator() / aMode.GetScaleY().GetDenominator();
+ nHeight = nHeight * rFraction.GetNumerator() / rFraction.GetDenominator();
aFont.SetHeight( nHeight );
mpMetadataDate->SetControlFont( aFont );
}
commit c9db32de2deeaa705e3da4945f62a94b75a7e4c5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Nov 17 17:07:47 2015 +0100
sw lok comments: fix comment widget width with custom zoom
When tiled rendering, then only the render context (or failing that,
SwViewShell::GetOut()) has the correct zoom level, so use that when
doing pixel-to-logic conversion or scaling pixel values.
Change-Id: I265a642b8253c6eced42da2a0e06a2de25c36ca8
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index b18cff5..e994b3d 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -870,7 +870,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext, const Rectangle& /*rRe
MapMode aMapMode(rRenderContext.GetMapMode());
aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
rRenderContext.SetMapMode(aMapMode);
- Size aSize(pPostIt->PixelToLogic(pPostIt->GetSizePixel()));
+ Size aSize(rRenderContext.PixelToLogic(pPostIt->GetSizePixel()));
Rectangle aRectangle(Point(0, 0), aSize);
pPostIt->PaintTile(rRenderContext, aRectangle);
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 99f4c39..145033d 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -285,7 +285,8 @@ void SwSidebarWin::PaintTile(vcl::RenderContext& rRenderContext, const Rectangle
continue;
rRenderContext.Push(PushFlags::MAPMODE);
- Point aOffset(PixelToLogic(pChild->GetPosPixel()));
+ const Fraction& rFraction(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
+ Point aOffset(PixelToLogic(pChild->GetPosPixel() * rFraction.GetDenominator() / rFraction.GetNumerator()));
MapMode aMapMode(rRenderContext.GetMapMode());
aMapMode.SetOrigin(aMapMode.GetOrigin() + aOffset);
rRenderContext.SetMapMode(aMapMode);
@@ -1402,7 +1403,7 @@ sal_Int32 SwSidebarWin::GetMetaButtonAreaWidth()
sal_Int32 SwSidebarWin::GetMetaHeight()
{
- const Fraction& f( GetMapMode().GetScaleY() );
+ const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
return POSTIT_META_HEIGHT * f.GetNumerator() / f.GetDenominator();
}
@@ -1413,7 +1414,7 @@ sal_Int32 SwSidebarWin::GetMinimumSizeWithMeta()
sal_Int32 SwSidebarWin::GetMinimumSizeWithoutMeta()
{
- const Fraction& f( GetMapMode().GetScaleY() );
+ const Fraction& f(mrView.GetWrtShellPtr()->GetOut()->GetMapMode().GetScaleY());
return POSTIT_MINIMUMSIZE_WITHOUT_META * f.GetNumerator() / f.GetDenominator();
}
More information about the Libreoffice-commits
mailing list