summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-13 17:00:40 +0000
committerCaolán McNamara <caolanm@redhat.com>2023-01-17 10:29:17 +0000
commita4a31e6a7b6e84689ff5dbafbd0baf1992729495 (patch)
tree9825e9fd4ea88c1c0e1f1740148fca7336847c00
parentreadme.xrm: update for macOS (diff)
downloadcore-a4a31e6a7b6e84689ff5dbafbd0baf1992729495.tar.gz
core-a4a31e6a7b6e84689ff5dbafbd0baf1992729495.zip
tdf#152990 set the font after the MapMode is (potentially) set
Change-Id: I64617a5c85e7e6b444aac705ebbfdd777b4ea55a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145442 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> (cherry picked from commit d5c8b38eab3d3766f403a33e11dffa498655be8f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145453 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx5
-rw-r--r--sw/qa/extras/layout/layout2.cxx23
2 files changed, 10 insertions, 18 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index bd92921396ae..8bd9abadf15c 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -306,7 +306,6 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
mpOutputDevice->SetLayoutMode(nRTLLayoutMode);
}
- mpOutputDevice->SetFont(aFont);
mpOutputDevice->SetTextColor(Color(aRGBFontColor));
OUString aText(rTextCandidate.getText());
@@ -364,6 +363,10 @@ void VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(
mpOutputDevice->SetMapMode(aMapMode);
}
+ // tdf#152990 set the font after the MapMode is (potentially) set so canvas uses the desired
+ // font size
+ mpOutputDevice->SetFont(aFont);
+
if (!aDXArray.empty())
{
const SalLayoutGlyphs* pGlyphs = SalLayoutGlyphsCache::self()->GetLayoutGlyphs(
diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx
index b8ba46bebc20..33196e019d86 100644
--- a/sw/qa/extras/layout/layout2.cxx
+++ b/sw/qa/extras/layout/layout2.cxx
@@ -1278,19 +1278,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf126244)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
// Test the first level of vertical category axis labels orientation. The first level orientation should be horizontal.
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[1]", "orientation",
- "0");
+ assertXPath(pXmlDoc, "(//font)[1]", "orientation", "0");
// Test the second level of vertical category axis labels orientation. The second level orientation should be vertical.
- sal_Int32 nRotation
- = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[5]",
- "orientation")
- .toInt32();
+ sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[5]", "orientation").toInt32();
CPPUNIT_ASSERT(nRotation >= 899);
CPPUNIT_ASSERT(nRotation <= 900);
// Test the third level of vertical category axis labels orientation. The third level orientation should be vertical.
- nRotation = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[4]/push[1]/font[7]",
- "orientation")
- .toInt32();
+ nRotation = getXPath(pXmlDoc, "(//font)[7]", "orientation").toInt32();
CPPUNIT_ASSERT(nRotation >= 899);
CPPUNIT_ASSERT(nRotation <= 900);
}
@@ -1307,18 +1301,13 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf127304)
xmlDocUniquePtr pXmlDoc = dumpAndParse(dumper, *xMetaFile);
CPPUNIT_ASSERT(pXmlDoc);
// Test the first level of horizontal category axis labels orientation. The first level orientation should be vertical.
- sal_Int32 nRotation
- = getXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[1]",
- "orientation")
- .toInt32();
+ sal_Int32 nRotation = getXPath(pXmlDoc, "(//font)[1]", "orientation").toInt32();
CPPUNIT_ASSERT(nRotation >= 899);
CPPUNIT_ASSERT(nRotation <= 900);
// Test the second level of horizontal category axis labels orientation. The second level orientation should be horizontal.
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[5]", "orientation",
- "0");
+ assertXPath(pXmlDoc, "(//font)[5]", "orientation", "0");
// Test the third level of horizontal category axis labels orientation. The third level orientation should be horizontal.
- assertXPath(pXmlDoc, "/metafile/push[1]/push[1]/push[1]/push[3]/push[1]/font[7]", "orientation",
- "0");
+ assertXPath(pXmlDoc, "(//font)[7]", "orientation", "0");
}
CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testHorizontal_multilevel)